<snip>
p.highlight {color:#f00}
p {color:#000;}
then all of the paragraphs will be black, including those using
class="highlight", as that is the "last" colour declaration.
</snip>
Well, not really. The "highlight" class will appear highlighted. In this
example, the relative specificity of the selector is used, not sequence. "p"
has a specificity of 1 while "p.highlight" has a specificity of 11. So
p.highlight rules.
That's the theory at least. Various browser implementations seem to
interpret this differently.
http://www.htmlhelp.com/reference/css/structure.html info on calculating
specificity
http://www.people.fas.harvard.edu/~dbaron/css/test/sec060403b an contrarian
view
Andy Hardacker
http://hardacker.com