100 Interview Question of CSS

Basics of CSS

  1. What is CSS?
  2. What are the different types of CSS?
  3. What is the difference between inline, internal, and external CSS?
  4. What are the advantages of using CSS?
  5. What is the syntax of a CSS rule?
  6. What is the use of the class and id selectors in CSS?
  7. What is the difference between class and id?
  8. How do you include CSS in an HTML page?
  9. What is a CSS selector?
  10. What is specificity in CSS?

CSS Selectors

  1. What is a universal selector in CSS?
  2. What is the difference between > and in CSS selectors?
  3. What does the + selector do in CSS?
  4. How do you select elements with a specific attribute in CSS?
  5. What is a pseudo-class in CSS?
  6. What is a pseudo-element in CSS?
  7. How do you style every third child element using CSS?
  8. How does the nth-child() pseudo-class work?
  9. What is the difference between :nth-child() and :nth-of-type()?
  10. What does the :not() selector do?

CSS Box Model

  1. What is the CSS box model?
  2. What are the components of the box model?
  3. How does margin differ from padding?
  4. What is the difference between border-box and content-box?
  5. How do you center an element using CSS?
  6. How do you make a website responsive using CSS?
  7. What is the use of z-index?
  8. What is the difference between position: absolute, relative, fixed, and sticky?
  9. What is the display property in CSS?
  10. What does visibility: hidden do?
  11. What’s the difference between visibility: hidden and display: none?
  12. How do you apply styles to visited and unvisited links?
  13. What are media queries?
  14. What is the use of overflow in CSS?
  15. What is collapsing margin?

CSS Flexbox and GRID

  1. What is Flexbox in CSS?
  2. How do you create a flex container?
  3. What are the main axis and cross axis in Flexbox?
  4. What does justify-content do?
  5. What does align-items do?
  6. What is the difference between align-items and align-content?
  7. What is flex-grow, flex-shrink, and flex-basis?
  8. What is shorthand for flex-grow, flex-shrink, and flex-basis?
  9. How do you align one item at the end in a flex container?
  10. What is the default value of flex-direction?
  11. What is CSS Grid?
  12. What’s the difference between Grid and Flexbox?
  13. How do you create a grid layout?
  14. What does grid-template-columns do?
  15. What is grid-gap?
  16. How do you place an item in a specific grid cell?
  17. What is the fr unit in CSS Grid?
  18. What is auto-fit and auto-fill in CSS Grid?
  19. Can Grid and Flexbox be used together?
  20. What does grid-area do?

CSS Units and Values

  1. What are the different CSS units?
  2. What is the difference between em and rem?
  3. What is the difference between %, vw, and vh?
  4. What are absolute and relative units in CSS?
  5. When would you use calc() in CSS?
  6. What is responsive web design?
  7. What are media queries and how are they used?
  8. What is a breakpoint in responsive design?
  9. How do you hide elements on smaller screens?
  10. What’s the difference between min-width and max-width in media queries?

CSS Positioning & Animations and Transitions

  1. How does position: absolute behave?
  2. What is the difference between relative and static positioning?
  3. What is sticky positioning?
  4. How does z-index affect layering?
  5. Can a positioned element be placed relative to a non-positioned parent?
  6. What is the difference between animation and transition?
  7. What is the use of transition in CSS?
  8. What properties can be animated with transition?
  9. How do you create keyframe animations in CSS?
  10. What does animation-fill-mode do?
  11. What are variables in CSS?
  12. How do you define and use a CSS variable?
  13. What is the inherit, initial, and unset value?
  14. What is the difference between important and specificity?
  15. What are pseudo-elements? Give examples.
  16. How do you make an element circular using CSS?
  17. How do you remove bullet points from a list?
  18. What is the difference between inline, block, and inline-block elements?
  19. How do you make a div scrollable?
  20. How can you create a sticky footer?

Browser Compatibility and Performance

  1. What are vendor prefixes in CSS?
  2. How do you handle cross-browser issues in CSS?
  3. How can you optimize CSS for better performance?
  4. What is the cascade in CSS?
  5. What is the purpose of a CSS reset?

Debugging and Tools

  1. How do you debug CSS in the browser?
  2. What are some browser dev tools used for CSS debugging?
  3. What is the use of outline in debugging?
  4. What is the difference between outline and border?
  5. How can you check if a CSS rule is being overridden?
  6. What is Bootstrap in CSS?
  7. What are the advantages of using CSS frameworks?
  8. What is a CSS preprocessor? Name some.
  9. What is the difference between SASS and SCSS?
  10. Can you write nested rules in plain CSS?

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!