Hi,
thanks for all the answers. I found that Spec, but was unsure if its
implemented cross browser the same way.
Also the dynamic adding of css classes seemed for me not 100%. As it could
also be : take current style, apply what has come additionally..
But it seems everything works here as I would expect it. I take your replies
as confirmation. Thank you.

Fabian

-----Original Message-----
From:
[EMAIL PROTECTED]
om
[mailto:[EMAIL PROTECTED]
groups.com] On Behalf Of Thomas Fuchs
Sent: Montag, 8. Januar 2007 16:06
To: [email protected]
Subject: [Rails-spinoffs] Re: Javascript/CSS question


See "Cascading order":
http://www.w3.org/TR/REC-CSS2/cascade.html#cascade

"Finally, sort by order specified: if two rules have the same weight, origin and specificity, the latter specified wins. Rules in imported style sheets are considered to be before any rules in the style sheet itself."

best,
thomas

Am 08.01.2007 um 15:46 schrieb Fabian Lange:


Hi,
I know that my question doesnt aim 100% at this group, but at least here are people that care for cross browser behaviour.

Is there a guaranteed behaviour for elements having multiple classes?

<div class="red blue">hello world</div>

when
div.red { background-color:red;}
div.blue {background-color:blue;}

it will be blue.

<div class="blue red">hello world</div>

will also be blue. So order in className will not matter.

when I switch the lines in the css:
div.blue {background-color:blue;}
div.red { background-color:red;}

it will be red in both cases.
So is the order of the css definitions always relevant for the style of the elements?

I noticed that adding or removing class name on runtime doesn't change this behaviour. Even when the first css class is added later on the div will look always like the second defined css class

So despite this being a bit odd to me (not the css definition but the element definition should infulence that imho), I wonder if all browsers behave the same here.

Thanks
Fabian

______________________________________________________________________ _ Viren-Scan für Ihren PC! Jetzt für jeden. Sofort, online und kostenlos.
Gleich testen! http://www.pc-sicherheit.web.de/freescan/?mc=022222


>

--
Thomas Fuchs
wollzelle

http://www.wollzelle.com

questentier on AIM
madrobby on irc.freenode.net

http://www.fluxiom.com :: online digital asset management
http://script.aculo.us :: Web 2.0 JavaScript
http://mir.aculo.us :: Where no web developer has gone before







--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to