Web Hosting CSS & Stylesheet Forums

Add Me

User Name
Password
Go Back   CSS & Stylesheet Forums > CSS Forumz: Main > Style Sheet In General

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:



Reply
  #1 (permalink)  
Old 08-28-2008, 02:09 AM
yawnmoth
Guest
 
Posts: n/a
Diggs:
Default CSS classes rendered differently than in-line CSS



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.
Reply With Quote


Sponsored Links
  #2 (permalink)  
Old 08-28-2008, 02:09 AM
Harlan Messinger
Guest
 
Posts: n/a
Diggs:
Default Re: CSS classes rendered differently than in-line CSS

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.
Reply With Quote


  #3 (permalink)  
Old 08-28-2008, 03:36 PM
Andreas Prilop
Guest
 
Posts: n/a
Diggs:
Default Re: CSS classes rendered differently than in-line CSS

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!
Reply With Quote


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 10:26 PM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.




Inactive Reminders By Mished.co.uk