By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,494 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,494 IT Pros & Developers. It's quick & easy.

stylesheet rules order

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.