Published on

CSS Interview Questions .md file

Authors
  • avatar
    Name
    Ganesh Negi
    Twitter
  • What is CSS and what is its purpose?

  • What are the different ways to include CSS in a web page?

  • How do you select an element with a specific class in CSS?

  • What is the box model in CSS?

  • How do you center an element horizontally in CSS?

  • How do you change the background color of an element in CSS?

  • What is the difference between padding and margin in CSS?

  • How do you add a border to an element in CSS?

  • What is the difference between inline and block-level elements in CSS?

  • How do you apply CSS styles to only the first letter of a paragraph?

  • What is the purpose of CSS selectors?

  • How do you apply CSS styles inline?

  • Explain the difference between an ID selector and a class selector in CSS.

  • How do you change the font size of an element in CSS?

  • What is the float property used for in CSS?

  • How do you change the text color of an element in CSS?

  • What is the CSS display property used for?

  • How do you create a hyperlink style in CSS?

  • Explain the difference between px, %, em, and rem units in CSS.

  • How do you add a background image to an element in CSS?

  • What is the purpose of the CSS z-index property?

  • How do you set the height and width of an element in CSS?

  • Explain the difference between position: relative; and position: absolute;.

  • How do you create a list without bullets in CSS?

  • What is the purpose of the CSS opacity property?

  • How do you align text to the center of an element in CSS?

  • Explain the difference between nth-child() and:nth-of-type() selectors.

  • How do you style all links within a specific container in CSS?

  • What is the CSS box-shadow property used for?

  • How do you create a horizontal navigation menu using CSS?

  • What are CSS pseudo-classes? Give some examples?

  • What is the difference between display: none; and visibility: hidden;?

  • How can you vertically align an element in CSS?

  • What is the difference between em and rem units in CSS?

  • What are CSS pseudo-elements? Give examples of their usage

  • What is the purpose of the CSS transform property? Give examples of its usage.