CSS INTERVIEW QUESTIONS
CSS INTERVIEW QUESTIONS
1. What is CSS?
2. What does CSS stand for?
3. What are the types of CSS?
4. How do you apply CSS to HTML?
5. What is the syntax of a CSS rule?
6. What is the difference between ID and Class selectors?
7. What are universal, element, and group selectors?
8. How do you add background color in CSS?
9. What is the difference between px, em, rem, and % units?
10. What are the padding, margin, and border properties?
11. What is the box model in CSS?
12. What is the difference between inline, block, and inline-block elements?
13. How do you center a block element?
14. What is z-index?
15. What is the use of the overflow property?
16. How do you apply multiple classes to a single HTML element?
17. What’s the difference between visibility: hidden and display: none?
18. How do you add a background image in CSS?
19. What is the difference between relative, absolute, fixed, and sticky positions?
20. What is a pseudo-class? Give examples.
21. What is a pseudo-element? Give examples.
22. How do you style links in CSS?
23. What is the difference between nth-child() and nth-of-type()?
24. What are media queries?
25. How do you make a responsive layout using CSS?
26. What is the !important declaration in CSS?
27. What are the global values in CSS?
28. How do you comment in CSS?
29. What are the different types of list styles in CSS?
30. What is the cursor property?
31. What is specificity in CSS?
32. How is specificity calculated?
33. What is the difference between inherit, initial, unset, and revert?
34. What is a CSS reset and why is it used?
35. What is the difference between rem and em units?
36. What is the difference between min-width, max-width, and width?
37. What is Flexbox in CSS?
38. List common Flexbox properties.
39. What is the difference between justify-content and align-items?
40. What is the difference between Flexbox and CSS Grid?
41. How do you center content using Flexbox?
42. What is order in Flexbox?
43. How do you create a two-column layout using CSS?
44. What is a media query breakpoint?
45. How do you make a sticky header in CSS?
46. What is the difference between position: sticky and fixed?
47. What is the object-fit property?
48. What is the opacity property?
49. What is rgba() and how is it used?
50. What are transitions in CSS?
51. What are animations in CSS?
52. What are keyframes in CSS?
53. What is the difference between transform: translate() and position: absolute?
54. How do you create a dropdown menu using CSS only?
55. What is a sprite and how is it used in CSS?
56. What are combinators in CSS?
57. How do you apply styles to an element based on its parent?
58. What is the difference between adjacent sibling and general sibling selectors?
59. What are vendor prefixes in CSS? Name a few.
60. How do you optimize CSS for performance?
61. How do you implement dark mode with CSS?
62. How do you create a responsive grid layout without using media queries?
63. What is line-height and how does it work?
64. What is white-space: nowrap and its use cases?
65. What is the difference between absolute inside a relative container vs static container?
66. How can you extend or reuse CSS styles?
67. Can a pseudo-element have content?
68. How can you style a file input in CSS?
69. What’s the difference between :is() and :where() pseudo-classes?
70. What is scroll-behavior and how do you use it?
71. How do you create glassmorphism effects using CSS?
72. How do you create neumorphism design using CSS?
73. What is the difference between auto, initial, and inherit?