Recall & Review
beginner
What is the 'Overqualified Selector' anti-pattern in CSS?
It happens when you use too many qualifiers in a selector, like
div.header instead of just .header. This makes CSS slower and harder to maintain.Click to reveal answer
beginner
Why is using
!important considered a CSS anti-pattern?Because it forces styles to override others, making debugging and future changes difficult. It breaks the natural cascading and specificity rules of CSS.
Click to reveal answer
intermediate
What problems arise from using deeply nested selectors in CSS?
Deep nesting creates complex selectors that are hard to read and maintain. It also increases CSS specificity, making overrides tricky and can slow down browser rendering.
Click to reveal answer
beginner
Explain the 'Global Styles' anti-pattern in CSS.
Applying styles globally (like styling all
p or div tags) can cause unintended side effects across the site, making it hard to control and predict styling.Click to reveal answer
beginner
Why is using fixed units like
px for font sizes considered an anti-pattern?Fixed units ignore user preferences and device differences, harming accessibility and responsiveness. Using relative units like
em or rem is better.Click to reveal answer
Which of the following is an example of an overqualified selector?
✗ Incorrect
Option D uses too many qualifiers (tag + classes), making it overqualified.
What is a major downside of using
!important in CSS?✗ Incorrect
!important forces style overrides, breaking CSS rules and complicating debugging.Why should you avoid deep nesting of selectors?
✗ Incorrect
Deep nesting increases specificity and makes CSS harder to maintain.
What problem can global styles cause?
✗ Incorrect
Global styles apply everywhere, which can cause unexpected changes in many places.
Which unit is better for font sizes to support accessibility and responsiveness?
✗ Incorrect
em and rem are relative units that adapt to user settings and screen sizes.Describe three common CSS anti-patterns and why they should be avoided.
Think about how these affect maintainability, performance, and debugging.
You got /3 concepts.
Explain why using fixed units like px for fonts can harm accessibility and responsiveness.
Consider how users might change font size settings or use different screen sizes.
You got /3 concepts.