473,479 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
1 2038
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3280
by: Catherine Lynn Smith | last post by:
OK, I am learning my way around the new DOM, but I am still at a loss on finding a few things. I have an HTML document that links to a stylesheet. /* START STYLESHEET EXAMPLE */ /*...
2
2802
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: August 28, 2002 Version: 1.15 URL: http://css.nu/faq/ciwas-aFAQ.html...
3
4313
by: Jamie | last post by:
Hi, Thanks for the excellent answer to my last question! One more: Does anyone have a method they follow for organizing stylesheets themselves? They seem like they can get bloated and hard to...
0
1941
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: April 10, 2003 Version: 1.16 URL: http://css.nu/faq/ciwas-aFAQ.html Maintainer:...
14
6589
by: theo | last post by:
if I have nested div combinations, can I call for styles only to specific nested combos? It's 3 lists <li>, on one page, needing different styles. <div id=list1><li> <a id="t1"...
5
1535
by: Andrew Poulos | last post by:
I'm trying to change a style in a stylesheet. The following code works in FF, MZ, and IE6 but IE 5 gives the error of "invalid procedure call or argument": var oStyleSheet =...
3
5137
by: 2good2b | last post by:
Is there a way to change the background color dynamically, when the color is defined at a CSS stylesheet? (tried document.bgcolor and this.style.background-color) Thanks
2
1624
by: J055 | last post by:
Hi I'm adding rules dynamically to the HtmlHead.StyleSheet using the CreateStyleRule method. I'd like to know how to check whether the rules already exist first. Thanks Andrew
6
2538
by: _Who | last post by:
I use the code below to change to a style sheet that has: body { ....
0
7027
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6899
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7019
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7067
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6719
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6847
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4463
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.