Cascade and rule order

The cascade is the algorithm that decides which declaration applies when several rules target the same property of an element. It takes into account origin, importance (!important), selector specificity and, in case of a tie, order: the last rule written wins.

Example

p { color: red; }
p { color: blue; }  /* the text will be blue */

Related concepts

The whole glossary