W3C home > Mailing lists > Public > www-style@w3.org > June 2003

Re: @import

From: Jens Meiert <jens.meiert@erde3.com>
Date: Sat, 28 Jun 2003 19:29:38 +0200 (MEST)
To: Brian V Bonini <b-bonini@cox.net>
Cc: www-style@w3.org
Message-ID: <13216.1056821378@www57.gmx.net>

> What is the real difference between using '@import' for external style
> sheets or 'link rel='? They both do the same thing no? DO they rank
> differently in the cascade, etc..??

As far as I know, the correct behavior of imported CSS would be to offer the
user a choice amongst the available <link /> stylesheets and ignoring the
others, and continue the cascade from there (if there are several imported
files, from top to bottom). So, on pages where I'm after the cascade, I may use
the <link /> element for the first stylesheet in the cascade, but anything I
want to follow is imported.

Note: '@import' is not recognized by older browsers. But thus you can link
to a stylesheet created for older browsers, and then use '@import' to include
a CSS reference which contains styles supported only by newer browsers (and
you can waive on any browser detection etc.). The styles in the imported sheet
will supercede those in the linked one because they come after the linked
sheet in the code, while older browsers will just ignore the '@import'
directive.


Regards,
 Jens.


-- 
Jens Meiert

Steubenstr. 28
D-26123 Oldenburg

Mobil +49 (0)175 78 4146 5
Telefon +49 (0)441 99 86 147
Telefax +49 (0)89 1488 2325 91

Mail <jens@meiert.com>
Internet <http://meiert.com>
Received on Saturday, 28 June 2003 13:29:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:22 GMT