467,910 Members | 1,623 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

stylesheet rules order

Often, a page will have more than one stylesheet. Some external and
some embedded.

If there are multiple rules that have *identical* selectors, will the
last one always take precedence? Any known instances where this is not true?

#section_1 DIV{color: red}
^^^^^^^^^^^^^^
By selector I meant that part. And I mean identical selectors.

Also, I tend to write in lower case. Is the upper case DIV preferred
to a lower case div in stylesheet syntax? I notice that when you use
javascript to iterate through a stylesheet it always upper cases these.

Jeff
Jan 15 '08 #1
  • viewed: 1885
Share:
1 Reply
Jeff wrote:
Often, a page will have more than one stylesheet. Some external and
some embedded.

If there are multiple rules that have *identical* selectors, will the
last one always take precedence? Any known instances where this is not
true?

#section_1 DIV{color: red}
^^^^^^^^^^^^^^
By selector I meant that part. And I mean identical selectors.
Go right to the source: http://www.w3.org/TR/CSS21/cascade.html#cascade
Also, I tend to write in lower case. Is the upper case DIV preferred to
a lower case div in stylesheet syntax?
No, use lower case. If you're using XHTML (not there's any reason why
you ought to be), you *have* to use lower case for both the tags and the
selectors.
I notice that when you use
javascript to iterate through a stylesheet it always upper cases these.
What do you mean by this? Upper-cases them *when*?
Jan 15 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jamie | last post: by
reply views Thread by Jan Roland Eriksson | last post: by
14 posts views Thread by theo | last post: by
5 posts views Thread by Andrew Poulos | last post: by
6 posts views Thread by _Who | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.