> http://www.frostjedi.com/terra/scripts/demo/trtd.html
> http://www.frostjedi.com/terra/scripts/demo/trtd2.html
[quoted text clipped - 3 lines]
> what's defined in-line in the second link is defined via a CSS class
> in the first.
Because a style set directly on an element has higher specificity than
stylesheet rules that match the element (in other words, the
directly-set style takes priority over the ".demo td" selector in the
inline stylesheet), while the ".demo td" selector has greater
specificity than the ".test" selector, the former consisting of a class
selector compounded with an element selector, while the latter consists
of only a class selector. See
http://www.w3.org/TR/CSS21/cascade.html#cascade
for details. From there, you will see that the style attribute has
specificity 1,0,0,0, the ".demo td" selector has specificity 0,0,1,1,
and the ".test" selector has specificity 0,0,1,0.
Andreas Prilop - 28 Aug 2008 15:14 GMT
> See
> http://www.w3.org/TR/CSS21/cascade.html#cascade
> for details.
Or, more specifically,
http://www.w3.org/TR/CSS21/cascade.html#specificity
But this is different from
http://www.w3.org/TR/REC-CSS2/cascade.html#specificity
What do browsers actually do?
For a small demonstration that relies only on CSS1 and
that does not use the STYLE attribute, see
http://www.unics.uni-hannover.de/nhtcapri/cascading-order.html
http://freenet-homepage.de/prilop/cascading-order.html

Signature
Solipsists of the world - unite!