HighDots Forums  

ordering of different style sheets, is it important?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss ordering of different style sheets, is it important? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Phil Thompson
 
Posts: n/a

Default ordering of different style sheets, is it important? - 09-21-2003 , 01:10 PM






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



Reply With Quote
  #2  
Old   
Peter Connolly
 
Posts: n/a

Default Re: ordering of different style sheets, is it important? - 09-21-2003 , 02:34 PM








"Phil Thompson" <phil (AT) xweb (DOT) freeserveSPAM.co.uk> wrote

Quote:
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




Reply With Quote
  #3  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: ordering of different style sheets, is it important? - 09-21-2003 , 03:25 PM



"Phil Thompson" <phil (AT) xweb (DOT) freeserveSPAM.co.uk> wrote:

Quote:
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/


Reply With Quote
  #4  
Old   
Stan Brown
 
Posts: n/a

Default Re: ordering of different style sheets, is it important? - 09-21-2003 , 06:12 PM



In article <bkkufk$nte$1$8302bc10 (AT) news (DOT) demon.co.uk> in
comp.infosystems.www.authoring.stylesheets, Peter Connolly
<noemailrequired (AT) nospamrequired (DOT) com> wrote:
Quote:
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/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.