Challenge - 5 Problems
CSS Anti-Patterns Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why is using
!important considered a CSS anti-pattern?What is the main problem caused by overusing
!important in CSS?Attempts:
2 left
💡 Hint
Think about how CSS rules are applied and how
!important affects that.✗ Incorrect
Using !important forces a style to override others, which can make it difficult to change styles later. This leads to messy and hard-to-maintain CSS.
📝 Syntax
intermediate2:00remaining
What error does this CSS snippet cause?
Consider this CSS code:
What error will this cause?
div { color: red; font-size 16px; }What error will this cause?
Attempts:
2 left
💡 Hint
Check the syntax for CSS property declarations carefully.
✗ Incorrect
CSS properties must have a colon : between the property name and value. Missing it causes a syntax error and the rule is ignored.
❓ selector
advanced2:00remaining
Which selector causes the worst performance issue?
Which CSS selector below is considered an anti-pattern because it slows down browser rendering the most?
Attempts:
2 left
💡 Hint
Think about how many elements the selector matches and how browsers process selectors.
✗ Incorrect
The universal selector * matches every element on the page, causing the browser to apply styles to all elements, which hurts performance.
❓ layout
advanced2:00remaining
What is the problem with using
float for layout?Why is using
float for page layout considered an anti-pattern in modern CSS?Attempts:
2 left
💡 Hint
Consider how floats affect the position and flow of elements on the page.
✗ Incorrect
Floats take elements out of the normal flow, which can cause parent containers to collapse and require extra fixes like clearfix. Modern layout methods like Flexbox and Grid avoid these problems.
❓ accessibility
expert3:00remaining
Which CSS practice harms accessibility the most?
Which CSS anti-pattern below can make content unreadable or unusable for people with visual impairments?
Attempts:
2 left
💡 Hint
Think about how color contrast affects readability for everyone.
✗ Incorrect
Low contrast between text and background colors makes it hard for users with vision impairments to read content, harming accessibility.