Top CSS Questions & Practice
Master 50+ essential CSS questions ranging from core fundamentals to advanced layout, browser behavior, accessibility, performance, and real-world scenarios.
Junior Fundamentals — Question 1
Test your understanding of the CSS box model.
Which four areas make up the CSS box model?
Junior Fundamentals — Question 2
Test your understanding of box sizing.
What does box-sizing: border-box do?
Junior Fundamentals — Question 3
Test your knowledge of selectors.
Which selector targets an element with class button?
Junior Fundamentals — Question 4
Test basic CSS inheritance.
Which property normally inherits from a parent?
Junior Fundamentals — Question 5
Test pseudo-class knowledge.
Which selector targets an element while the pointer is over it?
Junior Fundamentals — Question 6
Test pseudo-element knowledge.
Which is a pseudo-element?
Junior Fundamentals — Question 7
Test display behavior.
What happens when an element has display: none?
Junior Fundamentals — Question 8
Test units.
What does rem normally reference?
Junior Fundamentals — Question 9
Test color syntax.
Which is valid modern CSS RGB syntax with alpha?
Junior Fundamentals — Question 10
Test cascade fundamentals.
When two declarations have equal specificity, which normally wins?
Core Layout — Question 11
Test Flexbox axis knowledge.
With flex-direction: row, what is the main axis?
Core Layout — Question 12
Test Flexbox alignment.
Which property primarily distributes free space along the Flexbox main axis?
Core Layout — Question 13
Test Grid fundamentals.
What is the primary distinction between Grid and Flexbox?
Core Layout — Question 14
Test Grid sizing.
What does 1fr represent in a Grid track?
Core Layout — Question 15
Test responsive Grid knowledge.
Which pattern is commonly used for automatically responsive Grid columns?
Core Layout — Question 16
Test positioning.
What is a common reason to set position: relative on a parent?
Core Layout — Question 17
Test sticky positioning.
Which use case is suitable for position: sticky?
Core Layout — Question 18
Test z-index.
Why does a huge z-index not always place an element above everything?
Core Layout — Question 19
Test Flexbox sizing.
What does flex-basis control?
Core Layout — Question 20
Test Grid areas.
Which property assigns an element to a named Grid area?
Responsive & Modern CSS — Question 21
Test responsive design principles.
What should primarily determine a responsive breakpoint?
Responsive & Modern CSS — Question 22
Test mobile-first design.
What is mobile-first CSS?
Responsive & Modern CSS — Question 23
Test container queries.
What does a container query respond to?
Responsive & Modern CSS — Question 24
Test clamp().
What does clamp(1rem, 3vw, 2rem) mean?
Responsive & Modern CSS — Question 25
Test viewport units.
What does 100dvh represent?
Responsive & Modern CSS — Question 26
Test aspect ratio.
What does aspect-ratio: 16 / 9 provide?
Responsive & Modern CSS — Question 27
Test feature queries.
What does @supports provide?
Responsive & Modern CSS — Question 28
Test modern pseudo-classes.
What makes :has() different from many traditional selectors?
Responsive & Modern CSS — Question 29
Test specificity of :where().
What specificity does :where() contribute?
Responsive & Modern CSS — Question 30
Test :is() specificity.
How does :is() contribute specificity?