[thelist] CSS: question about @import

Jim Dabell jim-lists.evolt.org at jimdabell.com
Thu Jul 25 14:45:00 CDT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Thursday 25 July 2002 8:19 pm, Chris W. Parker wrote:
> hi.
>
> as far as i know it's recommended to use the @import command to hide
> advanced css from older browsers, i.e. nn4.x.
>
> i haven't heard anything about WHY i need to hide it from older
> browsers. i'm guessing that the older browser could get even more
> screwed up when it comes across advanced css. if this is not the case,
> won't the older browser(s) just skip over the css it does not
> understand?

The problem is not that it doesn't understand certain parts of css.  The
problem is that it _thinks_ it understands certain parts of css, when in
actual fact, it gets it wrong.

You get bugs like entire sections overlapping and normal links being
unclickable, or content halfway off-screen with no scrollbars.  By far the
worst offender, as I'm sure you've picked up, is nn4, which converts css
into jss internally, and then chucks the lot in a blender.


> also, when you import an advanced stylesheet, does it override
> everything in the primitive stylesheet? or does it just add-on to it?

It cascades, there are a few rules about what happens here, check the
standard or a tutorial for more info.


> in conclusion, please point out WHY i need to seperate the two, or why
> it doesn't matter. (i.e. i can stick everything in one css file and let
> the browser deal with it.)

You need to hide the advanced css because otherwise you break the site for
some unfortunate souls still using nn4 or equally poor browser.  Some
people choose to still give basic styling for these browsers, so they
separate the easy stuff (e.g. font-family) from the hard stuff (e.g.
positioning).

You should already be authoring in a way that doesn't exclude user-agents
that don't understand css.  My approach is to work around bugs in popular
browsers, and just hide the lot from broken browsers that aren't used much
any more.


- --
Jim


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9QFIu3tJNldoQhi8RAiqnAJ9YQCTyYRDaAXm/mpfZR2qfFDerBgCguDqW
qjV3pD3AvO8uXLUdu6fzIw4=
=/slY
-----END PGP SIGNATURE-----




More information about the thelist mailing list