9.3. CSS specificity#

All three articles are dated, but the concepts still apply. Read the first article on Specificity and Inheritance and scan the next two.

From Andy Clarke’s Stuff and Nonsense.

(a style attribute is an inline style)

View the Keegan Street’s Specificity Calculator for a visual way to understand the weighting.

For even more detail, read Smashing Magazine’s CSS Specificity: Things You Should Know

CSS Specificity Wars