← CSS Styling
CSS foundations · 15 MIN

Cascade, specificity and inheritance

Cascade, specificity and inheritance

The cascade considers origin, importance, cascade layers, specificity and source order. Inherited properties such as color flow to descendants; box-model properties generally do not. Browser developer tools show which declarations are active and overridden.

Try it yourself

Change the example, run it, and explain the result in your own words. Then create one variation of your own.

Key idea

Use the example as a starting point, not something to memorize. Practise, inspect the result and make small improvements.

Code example

body { color: #243b53; }
.notice { color: #a33; }