Lesson 23 / 30
Inheritance & the Cascade
Understand inherited properties and the full cascade order, and avoid overusing !important.
What inherits
Text-related properties like color, font-family, font-size, and line-height inherit from parent to child automatically. Box properties like margin, padding, and border do not.
The cascade order
When rules conflict, the browser checks in order: origin & importance (author styles vs !important), then specificity, then source order — the last rule of equal specificity wins.
Avoid !important
!important overrides normal specificity and is hard to undo later — reach for a more specific selector or reorganize CSS instead of reaching for !important.