CSS specificity and the cascade: why your styles win or lose
9 steps · about 2 h 44 min · Beginner
- Handling conflicts - Learn web development (tutorial, MDN Web Docs, 30 min)
It introduces cascade, specificity and inheritance together, so you know what each one does before going deeper.
- CSS SPECIFICITY: How CSS Specificity Is Calculated (video, YouTube, 10 min)
A short walkthrough of scoring selectors, which reinforces the MDN tables.
- Cascade, specificity, and inheritance (article, vikulin-va.ru, 12 min)
It treats a losing style as a cascade outcome, not a bug, and gives a simple three-question order for finding the winner.
- Specificity - CSS - MDN Web Docs (doc, MDN Web Docs, 15 min)
This is the reference for the exact ID-CLASS-TYPE scoring rules and the edge cases, including how it interacts with layers.
- Test your skills: The Cascade (interactive, MDN Web Docs, 15 min)
Hands-on exercises let you check that you can beat a high-specificity selector.
- The "C" in CSS: A Guide to Cascade, Specificity, and Inheritance (article, DEV Community, 12 min)
A second explanation with scored examples, including that the universal selector and combinators add no specificity.
- These CSS features give us more control on the cascade and specificity (video, Kevin Powell (YouTube), 15 min)
It moves on to modern tools such as layers and :where() that keep specificity under control.
- Cascade layers - Learn web development (tutorial, MDN Web Docs, 25 min)
It explains why layer precedence always beats selector specificity, which is the standard fix for specificity wars.
- Cascade Layers Guide (guide, CSS-Tricks, 30 min)
A complete guide to the @layer syntax, ordering, nesting and use cases once you grasp the idea.