How Cascading Works

As pointed out previously, the word cascading (p. 15) signifies that a CSS-styled document can derive style information from varying sources, rather than simply from a single style sheet. What is termed as the cascade is the mechanism by which styles from multiple sources can interact within the same document, with styles of higher weights falling (or cascading) through to be expressed in the document, while styles of lesser weights are caught up in the cascade and suppressed. If you think of the cascade as water flowing over a waterfall, cascading off of ledges and outcroppings, with gravity (or weight) entirely governing its course, that should give you a good visual hint of what the cascade is and how it works.

Modularity ...

Get Cascading Style Sheets (CSS) by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.