Should I have multiple CSS files?
its almost always best to load one combined css. if a particular page requires css is not likely to be visited often, include a page specific css in its templete seperately with a conditional script tag. Minimize all css files almost 100% of time.
How long can a CSS file be?
Is there any size limit on CSS file or on the number of lines? The answer, for IE9 and lower, is yes, depending on what you mean by “lines” and “size limit”. Size: the max size style sheet that IE9 and less will read is 288kb. Any styles after that mark do NOT get read.
How many CSS files should I use per page?
The fewer the better. If you can get away with one CSS file, that is great. I would say I average 2-3 CSS files per page. Keep in mind with CSS, it’s cascading style sheets, meaning that if I have 3 style sheets linked on a page, make sure you understand how the styles cascade down, or you may get some unexpected results.
Can a.php file be a.css file?
Every modern browser receives the .php file with the CSS code and processes it as a .css file. You can just use one css file for performance and then comment out sections like this: I’m using Jammit to deal with my css files and use many different files for readability.
Which is better a single CSS file or multiple CSS files?
In the end a single minified CSS file is what you want regardless of the technique you use. Less CSS, Less HTTP requests, Less Demand on the server. The advantage to a single CSS file is transfer efficiency. Each HTTP request means a HTTP header response for each file requested, and that takes bandwidth.
When do you need a global CSS file?
A global (there are probably some shared elements) and a CSS file specific to the unique pages. Sites that have distinct sections and then sub-templates of that section probably need a global, a section-specific, and a page-specific or one-off CSS file.