Afficher un message
Vieux 29/02/2008, 00h07   #4
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: your thoughts on applying multiple stylesheets to a page

..oO(William Gill)

>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.

>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
  Réponse avec citation
 
Page generated in 0,04960 seconds with 9 queries