Skip to content
Preptima
mediumConceptEntryMidSenior

What is cascading about Cascading Style Sheets, and which everyday CSS bugs does that one word explain?

The CSS cascade is the algorithm that picks one winning declaration per property per element: origin and importance first, then cascade layers, then specificity, then source order. Inheritance only fills in when nothing wins, which is why a rule on the parent never beats a declaration on the child.

4 min readUpdated 2026-10-09

Answer

Short answer

The CSS cascade is a sorting algorithm. For every property on every element, the browser collects all declarations that apply and ranks them by origin and importance, then cascade layer, then CSS specificity, then order of appearance. The top one wins. The CSS cascade explains most "my rule is not applying" bugs, and inheritance is a separate mechanism that only runs when nothing in the cascade produced a value.

Was this answer helpful?

Likely follow-ups

  • Body text is navy but every link stays blue no matter how specific you make the body rule. Where does the blue come from?
  • A component library ships with selectors two IDs deep. How do you override it without matching that specificity?
  • Why does an !important declaration in your reset layer beat an !important declaration in your utilities layer?
  • Two code-split chunks define the same class and the winner changes depending on which page loaded first. How do you make it deterministic?

Related questions

Further reading