Importing stylesheets

Hi all,

I recently picked up a copy of Andy Budd’s excellent book “CSS Mastery: Advanced Web Standards Solutions”. The first chapter mentions importing stylesheets using

@import url(...)

I’ve never come across this before. The edition of the book I have is from 2006, so I’m just wondering…

Is importing stylesheets something that’s commonly done these days, or is it an old-fashioned technique? Does anyone here regularly use the import rule? And, if so for what reason(s)?

Thanks in advance.

It used to be done to hide CSS from ancient browsers that couldn’t cope with even very basic CSS, like Netscape 4. It’s not necessary nowadays.

thanks for the info. :slight_smile:


You might find the entries in the Sitepoint reference useful for this:

There is not much difference except that import allows you to import other stylesheets from inside the actual stylesheet.

The link element can be used to set alternate, preferred and persistent stylesheets which import cannot do and which are used in styleswitchers. The link element can be used for other things also and not just stylesheets unlike @import.

Plus there are some existing threads on the subject also: