Forum Moderators: not2easy

Message Too Old, No Replies

importing vs linking stylesheets

pros and cons

         

wizpl

10:30 pm on Nov 4, 2005 (gmt 0)

10+ Year Member



does it make a difference in speed or efficiency, linking stylesheets vs importing. Does importing causes reloading the same css for every page?
(I know that @import is a hack against NS4, any drawbacks then)

JAB Creations

2:33 am on Nov 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It seems according to Eric Meyers that importing an stylesheet is the only way to avoid having issues with Netscape 4...

[ericmeyeroncss.com...]

I don't think something that I see on the frequency that I do is a standard just because of a browser (much less a specific one).

You've asked a good question...

madmac

7:39 am on Nov 7, 2005 (gmt 0)

10+ Year Member



@import may cause the content to load before the styles do, thus causing a "flickering" effect.

I always use a link, personally.

Who freakin' cares about NS4 anymore?

xfinx

7:55 am on Nov 7, 2005 (gmt 0)

10+ Year Member



NS4 is dead indeed. As I look in the accesslogs of different websites, I see NS4 standing at a serious 0%.
I don't care about NS4 aswell.. IE 5.0 get's the finger from me also.

JAB Creations

4:39 am on Nov 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With the Firefox crowd I've witnessed (with a very accurate GUI log) Firefox users updating their software (versions) very quickly. With incremental updates as useful as they are I am sure other browsers will eventually follow suite and updating browsers by a few dozen kbs each time will eventually become the defacto. The only major issue we'll deal with is how to deal with users still stuck on IE6 as we did for a period with Netscape 4. Heck, out of the 71% IE6 users so far this month 26% still hadn't upgraded to SP2 though I personally frown upon SP2 for numerous reasons.

jessejump

2:24 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



Import is lower in cascade than link.

drhowarddrfine

8:58 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The main purpose of @import is so you can conditionally include stylesheets using conditional statements or programatically depending on browser type or whatever.

chirp

9:55 am on Nov 9, 2005 (gmt 0)



You can also use @import from inside another style sheet

madmac

2:27 pm on Nov 11, 2005 (gmt 0)

10+ Year Member



>> The only major issue we'll deal with is how to deal with users still stuck on IE6 as we did for a period with Netscape 4.

You can use IE conditional statements to include IE only CSS. This is what I do now to deal with IE 5.5 (fix box model) and 6

>> Heck, out of the 71% IE6 users so far this month 26% still hadn't upgraded to SP2 though I personally frown upon SP2 for numerous reasons.

That is probably a 2 fold reason. As you say some people have not upgraded, but also Microsoft decided to make IE6 SP2 available only on Windows XP. So anybody running win 2k can only go as high as IE6 SP1.