Specificity
Specificity controls which rules win when one or more style declarations point to the same element.
Specificity is calculated this way:
- every HTML element selector gets a value of 1
- every class selector gets a value of 10
- every id selector gets a value of 100
- add up the numbers in the set of selectors; whichever one is highest wins
div {...} /* 1 */
p.content {...} /* 11 */
p.content ul li {...} /* 13 */
body div#primary h1.xHead {...} /* 113