[ Jump to content. Jump to navigation. ]

CSS "@import" notation should precede all other CSS declarations. I've been doing CSS-based layout for three years now, and this is the first time I've come across this rule, discovered while struggling with styles not showing on a project at work. Learn something new everyday, I guess.

Categories:
Tags:

2 Comments

Hey Pau, I've read that using the "@import" codes is actually one of the many css hacks, but according to this article/write-up (http://www.quirksmode.org/css/csshacks.html), it says that Netscape 4 doesn't parse any style sheet you import.

Then again, who still uses old browsers?

Pia - That's the idea behind using the @import command, to hide proper CSS from 4.0-era browsers which stumble over it. Netscape 4.x has a nasty tendency to crash when it encounters perfectly valid CSS, so the @import hack protects Netscape users from themselves.

Leave a comment