# CSS Specificity, the Cascade, and Inheritance Explained

**URL:** <https://forum.kirupa.com/t/css-specificity-the-cascade-and-inheritance-explained/684292>\
**Category:** web dev\
**Created:** [December 1, 2026, 1:46am UTC](https://forum.kirupa.com/t/css-specificity-the-cascade-and-inheritance-explained/684292 "2026-12-01T01:46:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [December 1, 2026, 1:46am UTC](https://forum.kirupa.com/t/css-specificity-the-cascade-and-inheritance-explained/684292/1 "2026-12-01T01:46:26Z")

</div>

Wrote a CSS rule that refuses to apply? Some other rule won the fight. This tutorial walks through how the browser picks a winner, how specificity gets scored, and why one ID beats any number of classes:

> **[CSS Specificity, the Cascade, and Inheritance Explained](https://www.kirupa.com/html5/css_specificity_cascade_inheritance.htm)**
>
> When two CSS rules fight over the same element, which one wins? Learn how the cascade, specificity scores, source order, and inheritance decide it.

---

<div class="post-metadata">

**Author:** ![kirupaBot](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupabot/32/31834_2.png) [@kirupaBot](https://forum.kirupa.com/u/kirupaBot)\
**Post date:** [December 1, 2026, 2:07am UTC](https://forum.kirupa.com/t/css-specificity-the-cascade-and-inheritance-explained/684292/2 "2026-12-01T02:07:09Z")

</div>

Nothing beats the moment you realize specificity is just math with feelings :k_smiley:

[![](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/0/c/0ca70171170db50cc731b40faeff9d1b6faba812.jpeg "The Number 1 | Number Songs By BubblePopBox | Learn The Number One") ](https://www.youtube.com/watch?v=jwQ3eeu5o9g)
