Nice primer. Specificity is one of the more difficult concepts to grasp in CSS.
Another good thing to remember is that specificity is cumulative when one selector is made up of several selector types.
"div p" is more specific than "p".
"#home #content" is more specific than "#content".
"#content p" is also more specific than "#content", as is "div#content".
And so on.
And note that pseudo-class selectors have the same specificity as class selectors, so "a.contact" is equal to "a:link". With rules of equal specificity, the cascade takes over and they're applied in the order in which they're written.
Trending Articles
More Pages to Explore .....