Grokking CSS for Web Development
Vote

0% completed

​

The Cascade, Specificity, and Inheritance

Three rules on the hiking page set a color or a background on the first paragraph or on the link inside it: the .important rule, the #intro rule, and a rule in the browser's own style sheet. Each property can still have only one value. The browser picks it by running every competing declaration through a fixed series of tests, and this series is called the cascade.

The ID lesson showed two of those tests, specificity and source order. This lesson places them in the full series, and then explains inheritance, which supplies a value when no rule sets one at all.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content