DevAcademy
PracticeCSSIntermediate

CSS Intermediate Practice

27 questions covering 9 CSS topics.

Quick Quiz

1. Which position value is the default for every element?

2. What is an absolutely positioned element positioned relative to?

3. How does position: sticky behave?

4. Which property turns a container’s children into flex items?

5. Which property centers flex items along the main axis?

6. What does flex: 1 do to a flex item?

7. What does the fr unit represent in a grid?

8. Which property lets an item span multiple columns?

9. When is CSS Grid generally preferred over Flexbox?

10. Which overflow value clips extra content without showing a scrollbar?

11. Which overflow value only shows a scrollbar when content actually overflows?

12. Which three properties combine to truncate text with an ellipsis?

13. Does z-index affect elements with position: static?

14. What can create a new stacking context besides positioning with z-index?

15. Why might a child with z-index: 9999 still appear behind another element?

16. Which pseudo-class matches an element while the pointer is over it?

17. Which pseudo-class selects every other list item for a zebra-stripe effect?

18. Why is styling :focus important, not just :hover?

19. How many colons do pseudo-elements use, unlike pseudo-classes?

20. Which property is required for ::before or ::after to render anything?

21. Why should ::before/::after avoid holding essential information?

22. Which of these has the highest specificity?

23. When two rules have equal specificity, which one wins?

24. Why should !important be used sparingly?

25. Which combinator selects only direct children?

26. Which combinator selects the single element immediately following another?

27. What does the descendant combinator (a space) match?