CSS3: From Knowledgable to Ninja – Part 2 Specificity

understanding specificity

ID
1-0-0

Class
0-1-0

Element
0-0-1

Estelle Weyl handed out a great reference guide to specificity or in this case speciFISHity where an ID is like a shark, a class is like a fish and an element is like plankton – literally Plankton from Spongebob Squarepants! inline styles are like the BP oil spill and !important blows them all out of the water.

The * selector, or global selector, has no value.

* {} 0-0-0

Combinators, like ~, >, and + have no value

ul li {} 0-0-2
ul > li {} 0-0-2

:not has no value, but parameter selector does

.myClass:not(p) {} 0-1-1

Specificity is not inheritance.