Re: NN7 and @import

by "Darrell King" <darrell(at)webctr.com>

 Date:  Thu, 17 Oct 2002 14:29:16 -0400
 To:  <hwg-techniques(at)mail.hwg.org>
 References:  hotmail nucleus
  todo: View Thread, Original
But, if the @import rule is used *within* and external stylesheet, I believe
it has to be at the top of that external file

...?

D

----- Original Message -----
From: Rob Atkinson

Peter-Paul Koch wrote:

>
>
> > Actually, the book is quite correct -- I think. Not seeing
> the example
> > myself (and not sure what "third line down" is referencing)
> the logic
> > is right on. Browsers that understand the @import rule will
> use it,
> > even if preceded with other CSS rules.
>
>
> That's not true, unfortunately. The specs are quite clear: @import
> should come first. Explorer ignores the specs on this point,
> but Mozilla
> doesn't. In Mozilla it is therefore necessary to make the
> @import rule
> the first style.
>
> ppk


Seems we may be getting confused on implementation here.

This is an example of how I "used to" do CSS in my HTML pages:

<link rel="StyleSheet" href="browsers < v5.css" />
<style type="text/css">
@import url("browsers > v5.css");
</style>

If I do it that way it works as shown. Browsers that don't
understand @import will ignore it but apply the "link rel" CSS.

If I turn that around and use:

<style type="text/css">
@import url("browsers > v5.css");
</style>
<link rel="StyleSheet" href="browsers < v5.css" />

It still doesn't bother Browsers that do not understand @import
as they will still ignore it. But, Browsers the understand both
become confused and will use some of both -- at least, that is
what my testing showed with Netscape 4.8, Mozilla 1.2b, and IE
5.01. Opera 6.0 correctly used the @import CSS -- no matter if
@import was first or second and, totally ignored the "link rel"
CSS no matter if first or second.


Part of the confusion is my fault. The statement I made and
quoted by Paul, is what I used to use when I was coding for
Netscape <v5.x and still wanted the Browsers >v5.x to show the
better CSS coding.

It's been a few months now since I started coding "only" for
Browsers v5.x and higher. It's amazing what a person can forget
in such a short period of time. :-)


Website Rob
Sitemaster at
http://www.PotentProducts.com
------------------------------------------
Helping people create a Potent Web Site

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA