[thelist] hiding CSS

aardvark roselli at earthlink.net
Sun Apr 14 21:39:00 CDT 2002


> From: Erik Mattheis <gozz at gozz.com>
[...]
> >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. --

i do disagree with you, primarily because @import *isn't* necessarily a
hack... it's actually akin to include and extremely useful for compiling CSS
files so you can have one handle layout, another do colors, another control
type, etc...

however, currently, many of us use @import to prevent older browsers from
seeing code that would otherwise break them...

if we switched to JS instead of @import, we'd now punish not just users of
older browsers, but users without JS enabled on their primary browsers -- like
me...

JS document.write certainly has its place, and the decision should be made
on a case-by-case basis, but so far i've had very good luck *not* using JS to
dynamically write in links, also reducing page size (a bit) and rendering time
(a little bit)...

now, if we really want to use some CSS hacks, then the original poster can
try modifying the syntax of the @import call to see what causes to be
seen/hidden from all desired browsers...  things like removing the quotes or
the parentheses, or using @import to @import another sheet, etc...

i would probably go the JS route before i start hacking my CSS, but again, i've
not needed to do either...




More information about the thelist mailing list