468,107 Members | 1,410 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

ordering of different style sheets, is it important?

does it matter in which order i place different style sheets
i.e.
<link rel="stylesheet" type="text/css" media="screen"
href="style/screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="style/print.css"
/>

is this better than this

<link rel="stylesheet" type="text/css" media="print" href="style/print.css"
/>
<link rel="stylesheet" type="text/css" media="screen"
href="style/screen.css" />

I ask because when viewing the a site in the browsers it doesn't seem to
matter but when editing the page in dreamweaver it displyas only my print
stylesheet so editing the site is difficult.

Phil
Jul 20 '05 #1
3 2592


"Phil Thompson" <ph**@xweb.freeserveSPAM.co.uk> wrote in message
news:bk**********@news6.svr.pol.co.uk...
does it matter in which order i place different style sheets
i.e.
<link rel="stylesheet" type="text/css" media="screen"
href="style/screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="style/print.css" />

is this better than this

<link rel="stylesheet" type="text/css" media="print" href="style/print.css" />
<link rel="stylesheet" type="text/css" media="screen"
href="style/screen.css" />

I ask because when viewing the a site in the browsers it doesn't seem to
matter but when editing the page in dreamweaver it displyas only my print
stylesheet so editing the site is difficult.

Phil

Specificity moves upwards; styles defined in code have a higher priority
than styles written inline, which have a higher priority than linked or
imported styles. Where more than one stylesheet is linked or imported, the
one lower down in the code has the higher priority. You still have to watch
inheritance, and (I believe) some version 4 browsers ignore a rule totally
where there is a conflict in two different style sheets.

None of which, of course, answers your question! The real answer, assuming
you use Dreamweaver MX, is to look in the Dreamweaver help for 'Using Design
Time style sheets'.

HTH,

Pete.
--

Derby
UK
Jul 20 '05 #2
"Phil Thompson" <ph**@xweb.freeserveSPAM.co.uk> wrote:
does it matter in which order i place different style sheets


In general it does, since the order of rules is relevant in the cascade.
But in your case it does not, since the two <link> elements have different
and mutually exclusive media attributes. In any given situation, at most
one of the style sheets is used by the browser.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #3
In article <bk*******************@news.demon.co.uk> in
comp.infosystems.www.authoring.stylesheets, Peter Connolly
<no*************@nospamrequired.com> wrote:
Specificity moves upwards; styles defined in code have a higher priority
than styles written inline, which have a higher priority than linked or
imported styles. Where more than one stylesheet is linked or imported, the
one lower down in the code has the higher priority. You still have to watch
inheritance, and (I believe) some version 4 browsers ignore a rule totally
where there is a conflict in two different style sheets.

None of which, of course, answers your question!


Did you miss the fact that the two linked style sheets had non-
overlapping media specifications? In that case I don't think it
makes any difference which order they occur in.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Geoff Cox | last post: by
2 posts views Thread by Dr. Richard E. Hawkins | last post: by
12 posts views Thread by Jarno Suni | last post: by
9 posts views Thread by Radium | last post: by
1 post views Thread by mscertified | last post: by
53 posts views Thread by Jonas Smithson | last post: by
5 posts views Thread by =?Utf-8?B?SmVycnkgQw==?= | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.