[thelist] hiding CSS

Duncan O'Neill dbaxo at ihug.co.nz
Sun Apr 14 21:40:01 CDT 2002


Erik Mattheis wrote;

> >Hi all,
> >
> >I'm updating my site, and have a question about hiding CSS
> >from old browsers.
> >
> >Until I saw what a mess MacIE4.5 made of the page, I was using
> >the @import "stylesheet.css";
>
> People may disagree with me, but for the exact type of problems you
> cite, I thing using @IMPORT to give different CSS to different
> browsers is a bad idea. Use JavaScript and document.wrote a link to
> an external stylesheet. Resort to using navigator.userAgaent is a
> necessity if you want the greatest level of control over CSS display
> unless you don't care about anything but the most common browsers.
> --

Erik,

I'm one of those who will disagree with you.:-)

What happens to the 10%-20% of users with no javascript? No
stylesheets.

Another problem is the number of forks required.  A comprehensive
javascript browser-sniffer has to fork for platform, browser, & version,
which is going to take multiple lines.

Using import takes one line, and in its simplest form only requires two
stylesheets, one of which can be very basic.

cheers,

Duncan O'Neill
================================================







More information about the thelist mailing list