My site has several pages that are very different from each other. Would it be better to use one CSS file or one for each page? (I have around 5 pages that are different from each other - the rest are the same.)
Well some elements are the same, such as the logo, menu etc but the main body is layed out differently. Maybe I should just section out my CSS file for the different pages?
If the layout and grid are large differences, you had better to use multiply css files, Otherwise use one css file.
In that case I'd have one for the elements that are the same, and then different ones for the layout changes if they are substantial changes. If they're only a few then you might as well have them in one css file.
Yep, I agree on that one. Depending on the size of these CSS files, you might want to create one bigger file and clean your CSS somewhat. This reduces loading times since your reduce the amount of HTTP GET request. After this first load, all files will be present in the browsers cache, and don't need to be downloaded again
One css file is enough, because big ones with 1,000 lines or more, are about 20 Kb. To understand better what it is going on in the css file, put comments above sections like this /* add descriptions*/. It is much simpler to connect to one external css file than multiple ones.
Agreed. I want to have all my styles in just one document, which I can ctrl+f in to find everything. Multiple files is a pain. There are exceptions though. My husband's company has a base CSS file, and that single website serves many newspapers, who want their own header styles. So it made more sense in that case to have a basis.css and then tacked onto the bottom (a second css link in the <head>) the header-specific styles for that newspaper: dailytimes.css It was easier for the server, since most people visiting one newspaper don't go to visit other ones, so it's still just 2 css files and not several. None of my sites, even those with styles for IE6 that are completely different from other browsers, have more than a single stylesheet.
Or use classnames and ID's that actually identify what the elements ARE, not how they appear (see why CSS frameworks are made of /FAIL/) It really is a loaded question - As a rule I like to say that I prefer only one CSS file per media type, and I try to avoid sharing a CSS file across media types, but truly if just one page that not every visitor is going to go to has unique elements on it, I say go ahead and make one more file... But that's it. So one file preferred, but certainly no more than two files per media type. You do include a media attribute, right?