Combine All CSS Media Styles Into Single File
As a web designer, we know that we can apply different stylesheets for different media. The following is the most common method used.
The above code requests two separate stylesheets, one for global media styles (screen, print, handheld, tv…) and one for print only. There is nothing wrong with the above, but if load time is an issue you could save yourself a server request by combining your CSS files:
/* all media */
@media all
{
body { color:#666; font:13px arial, helvetica, sans-serif; padding:20px 0 30px 0; }
}
@media print
{
body { color:#000; font:12px arial, helvetica, sans-serif; padding:0; }
}
What you need to do is just address each media by using “@media [media] { /* css here */ }”. This method is easier for us to do editing too.
Popularity: 27% [?]