Cascade

How CSS decides which rule wins when rules disagree.

What is the cascade in CSS?

The cascade is how CSS decides which rule wins when several set the same property on the same element. It weighs importance, specificity and the order the rules appear.

p { color: gray; }
p { color: black; }   /* wins: same strength, comes later */

Level: Novice · More CSS terms at this level

Updated