Forum Moderators: not2easy

Message Too Old, No Replies

@import and breaking up large css files

         

kenpachi

10:01 pm on Apr 21, 2008 (gmt 0)

10+ Year Member



Does anyone know if there is any benefit to using an @import inside a style sheet vs having multiple import statements in your html file? Does it cut down on the number of requests at all?

swa66

11:35 pm on Apr 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It would create more requests IMHO.

I don't use them at all. I try to have a very few CSS files that I <link>. I try to have one that covers most of the site, and might have a few to do some special things or to have a heavy part of the site not bother all the other pages.

For e.g. print styling I use in side the CSS file itself

@media print {
#menu, #crum, #ads {display:none;}
}

kenpachi

12:43 am on Apr 22, 2008 (gmt 0)

10+ Year Member



I guess they both create the same amount of requests. I just use them because it makes it easier to maintain and update.