Skip to content

CSS Basic Sheet

Basic CSS Questions:

  1. What is CSS and why is it used?
  2. How do you link a CSS file to an HTML file?
  3. What is the difference between inline, internal, and external CSS?
  4. How can you apply multiple classes to an HTML element?
  5. What is the CSS box model? Explain its components.
  6. How do you center a block element horizontally?
  7. What is the difference between margin and padding?
  8. How do you create a CSS rule that applies to all <p> elements?
  9. What are CSS selectors? List some common selectors.
  10. How can you apply styles to a class and an ID in CSS?
  11. Explain the concept of specificity in CSS.
  12. What are pseudo-classes and pseudo-elements in CSS? Give examples.
  13. How can you make a list horizontal using CSS?
  14. What is the z-index property and how is it used?
  15. How can you make a website responsive using CSS?
  16. What is a CSS reset? Why is it used?
  17. Explain the difference between absolute, relative, fixed, and sticky positioning.
  18. How do you use float and clear properties in CSS?
  19. What is the display property in CSS and what are its possible values?
  20. How do you hide an element in CSS?

Intermediate CSS Questions:

  1. What is Flexbox and how do you use it?
  2. Explain the CSS Grid layout and its advantages over Flexbox.
  3. How do you create a grid layout with CSS Grid?
  4. What is the ::before and ::after pseudo-elements? Provide examples.
  5. How do you create a responsive navigation bar using CSS?
  6. What are media queries and how do they work?
  7. How do you use CSS transitions? Give an example.
  8. Explain CSS animations and keyframes.
  9. How can you create a gradient background in CSS?
  10. What are CSS preprocessors? Explain the use of SASS or LESS.
  11. What is the difference between em and rem units in CSS?
  12. How do you create a CSS variable and use it?
  13. Explain the concept of clipping in CSS.
  14. How can you create a CSS shape like a circle or triangle?
  15. What is the box-sizing property and how does it affect the box model?
  16. How do you apply a shadow to an element using CSS?
  17. What is the overflow property and how is it used?
  18. How do you create a tooltip using CSS?
  19. What are the different ways to apply custom fonts in CSS?
  20. How can you create a responsive image gallery using CSS?

Advanced CSS Questions:

  1. Explain the concept of CSS specificity and how to calculate it.
  2. What is the @supports rule in CSS?
  3. How can you create complex animations using CSS?
  4. What is the calc() function in CSS and how is it used?
  5. How do you handle browser compatibility issues in CSS?
  6. Explain the use of will-change property in CSS.
  7. What is the content-visibility property and how does it improve performance?
  8. How can you use CSS to create a parallax scrolling effect?
  9. What is the difference between visibility and opacity properties?
  10. Explain the concept of CSS Houdini and its potential impact on web development.
  11. How do you use the @font-face rule in CSS?
  12. What is the backface-visibility property used for in CSS?
  13. Explain the concept of min-width and max-width in responsive design.
  14. How can you create a fixed header that stays at the top of the page using CSS?
  15. What is the difference between nth-child and nth-of-type selectors?
  16. How do you use the pointer-events property in CSS?
  17. How can you create a CSS-only dropdown menu?
  18. Explain the concept of the CSS cascade and how it affects the application of styles.
  19. How do you use the filter property in CSS?
  20. What are the differences between CSS transition and animation properties?
  21. What is the clip-path property and how do you use it?
  22. How can you create a CSS grid layout with fixed and flexible columns?
  23. What is the object-fit property and how is it used with images and videos?
  24. How do you create a custom scrollbar using CSS?
  25. Explain the concept of CSS logical properties and values.
  26. How do you create a multi-column layout using CSS?
  27. What is the :focus-within pseudo-class and how is it used?
  28. How do you use the scroll-snap properties in CSS?
  29. What is the mix-blend-mode property and how do you use it?
  30. How can you create a CSS-only modal popup?

Expert CSS Questions:

  1. Explain the concept of CSS Grid areas and how to use them.
  2. How can you create a responsive layout using CSS Grid and Flexbox together?
  3. What is the contain property in CSS and how does it improve performance?
  4. How do you use the :target pseudo-class to create in-page navigation?
  5. What are CSS functions like var(), attr(), and env()? Provide examples.
  6. How do you implement a dark mode switch using CSS custom properties?
  7. What is the is() pseudo-class and how does it simplify writing CSS selectors?
  8. How can you create a 3D effect using CSS transforms and perspectives?
  9. What is the aspect-ratio property and how do you use it in responsive design?
  10. How do you create a responsive typography scale using CSS?
  11. How do you write maintainable and scalable CSS code?
  12. What are some common CSS naming conventions, like BEM, and why are they used?
  13. How do you optimize CSS for performance?
  14. What are the best practices for organizing and structuring CSS files?
  15. How do you handle large CSS projects and manage CSS dependencies?
  16. What are CSS architecture methodologies like OOCSS, SMACSS, and ITCSS?
  17. How do you debug CSS issues effectively?
  18. What are some common CSS pitfalls and how do you avoid them?
  19. How do you use CSS in a component-based framework like React or Vue?
  20. How do you ensure accessibility (a11y) in your CSS design?

CSS Tools and Frameworks:

  1. What are CSS frameworks like Bootstrap, and how do they simplify development?
  2. How do you use CSS-in-JS libraries like styled-components or Emotion?
  3. What is Tailwind CSS and how does it differ from traditional CSS frameworks?
  4. How do you integrate CSS with modern build tools like Webpack or Parcel?
  5. What is PostCSS and how does it extend CSS with plugins?
  6. How do you use CSS Modules in a project?
  7. What are the advantages of using a CSS preprocessor like Sass or LESS?
  8. How do you implement CSS theming in a web application?
  9. What is the purpose of CSS linting tools, and how do you use them?
  10. How do you use CSS to create adaptive designs for different devices and screen sizes?

These additional questions should provide a thorough coverage of CSS concepts, techniques, and best practices.