HighDots Forums  

Re: your thoughts on applying multiple stylesheets to a page

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


Discuss Re: your thoughts on applying multiple stylesheets to a page in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Fesser
 
Posts: n/a

Default Re: your thoughts on applying multiple stylesheets to a page - 02-28-2008 , 06:07 PM






..oO(William Gill)

Quote:
I have a main stylesheet that I apply to all pages in a site, they each
sub-section has a subsection stylesheet that either overrides or applies
new style to pages in that subsection, then finally each page in a
subsection may need even more fine tuning.

In the past I would use <link href="page.css" rel="stylesheet"
type="text/css">, then in page.css I would import section.css, and
section.css would import main.css.

I am looking at changing to multiple link tags like:
link href="main.css" rel="stylesheet" type="text/css"
link href="section.css" rel="stylesheet" type="text/css"
link href="page.css" rel="stylesheet" type="text/css"

Assuming I am careful to consider the cascade, is there anything I
should be careful of using this method to apply multiple stylesheets?
Not really. I use both ways in my projects.

For example there is a main stylesheet shared between various projects
and some additional project-specific stylesheets, all applied with
'link' elements like above. The shared main CSS also uses a number of
@import rules to include some other files, which are kept separately
simply for the ease of maintenance.

The only little drawback is the number of HTTP requests required in
order to download all these files. Every 'link' and every @import counts
and might slow down the page rendering on the first request. After that
all CSS should be in the browser cache.

Quote:
Also, what are the implications of using or not using a common title
attribute?
If you're referring to the 'title' attribute for CSS links - they can be
used to offer alternative stylesheets which the user may choose from.

Micha


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.