![]() |
|
Welcome to the CSS & Stylesheet Forums forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: |
![]() |
|
|||
|
http://www.frostjedi.com/terra/scripts/demo/trtd.html http://www.frostjedi.com/terra/scripts/demo/trtd2.html Why don't those look the same in Firefox? The latter is the rendering I'd expect for the first one, as well. The only difference is that what's defined in-line in the second link is defined via a CSS class in the first. |
| Sponsored Links |
|
|||
|
yawnmoth wrote:
> http://www.frostjedi.com/terra/scripts/demo/trtd.html > http://www.frostjedi.com/terra/scripts/demo/trtd2.html > > Why don't those look the same in Firefox? The latter is the rendering > I'd expect for the first one, as well. The only difference is that > 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. |
|
|||
|
On Wed, 27 Aug 2008, Harlan Messinger wrote:
> 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/nht...ing-order.html http://freenet-homepage.de/prilop/cascading-order.html -- Solipsists of the world - unite! |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
- Contact Us
-|-
CSS & Stylesheet Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise