PDA

View Full Version : Best way to deal with multiple style sheets?



aze
13 Sep 2007, 10:38 AM
I am helping to optimize a site that is built using multiple style sheets. Each sheet is currently linked. When loading, the browser waits for the full sheet to load before requesting the next sheet.

Should we have all styles in one sheet?

Should we use import to add in additional styles?

What is the optimum way to handle multiple sheets?

Allie

Wickham
13 Sep 2007, 02:04 PM
Using imports from a different domains will definitely slow loading, but if all stylesheets are from the same directory speed shouldn't be a problem.

However, you don't want to have the same styles in different stylesheets as the browser should operate the last style it finds, but it may get muddled and take the wrong stylesheet first.

Try to keep the separate stylesheets for completely different parts of the page, like separate style sheets for a drop down menu or a form or just the font styles and colors.