One style sheet, or more?

If I have five separate published pages that link to each other, that have the same header and footer and some of the same html elements. is it better to have separate stylesheets for each, one stylesheet for all, or one for all of the common elements and then a separate additional one for each page’s unique elements?

I’m thinking of page loading in particular and how many server requests need to be made. Initially I tried to get it all into one css then realized some pages did not need most of the styling code. And then also began to suspect that as far as server requests, each time a nav link was clicked and a new page opened, all the css had to be reloaded again anyway (I think).

I used one of those page speed testers. All the pages loaded under something I read about max times. To my eye it’s all fast enough as is. What I did see was more server requests than I expected on a page without images. Also a lot of space it their pie chart was taken up by css.

Since I will be redoing everything as I learn more, I would like to do it correctly.

I was able to get html validation. Css did not validate because of some generated code for gradients, but it all displays OK.

In my view, one style sheet is best. Once the first page has been visited, the stye sheet is cached by the browser, so it doesn’t need to be downloaded again. :slight_smile:

Ah, thank you! I had gotten most of it into one css already but I often was seeing head links to more than one style sheet and thought maybe that reduced load times or something.

It’s more calls to the server to have multiple styles, and CSS files aren’t usually that big—less than the average image. It’s also easier to work with one style sheet, at least for me.

If the site is really large and has separate sections (account pages, user pages, transaction pages) then it would make sense to have separate stylesheets for those disparate sections as each section may be very large and unique and then one css file could be unmanageable or at the least much much bigger than needed for that particular visitor.

However, as Ralph said most normal sized sites can do with one stylesheet.

In the end (if speed is not an issue) then its a matter of choice and some coders like to have separate css files for all sorts of things but it just doesn’t work for me.