Lesson 4 of 50
cssThe Cascade & Specificity
12 mins
Course progress8%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 4 of 50
css12 mins
Keep these ideas in mind as you work through the lesson.
When several rules match the same element the cascade decides which wins.
!important overrides normal rules.Specificity score: inline(1,0,0,0) > id(0,1,0,0) > class(0,0,1,0) > element(0,0,0,1).
/* lowest */ p { color:gray; }
/* higher */ .note { color:blue; }
/* highest */ #important { color:red; }