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

William Gill wrote:
> 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?


The issue with multiple stylesheets, is that each one has to be fetched.
three links will give the browser the opportunity to fetch them in
parallel, will some, but the overhead is still heavy.

Include the page stuff in the page or into the session file.

Then probably use one link to the section css file which would contain
the main.css stuff repeated for each.

If the main is large and the section one tiny I might use two links, but
I prefer to use one. That way I can see it all the CSS in one place.

The overhead of sending css to the browser that is not used in a page,
is tiny, if the css is reused in later pages.

> Also, what are the implications of using or not using a common title
> attribute?
>

What? The title attribute provides text that appears as a tool tip to
the user, for various durations, in some browsers, and not at all in
other browsers. Not a CSS issue.

Regards

Ian

  Réponse avec citation
 
Page generated in 0,06310 seconds with 9 queries