@import hack (was Re: [thelist] Form CSS styles)

MRC webmaster at equilon-mrc.com
Thu Jan 17 13:16:15 CST 2002


Andrew,

> > And what excactly don't you like about using @import?
>
> I just don't like the idea of embedding one language in another; it's
> easiest for everyone if styles stay in a stylesheet and executable code(*)

    I haven't been following this entire thread, so I may well have missed
something. But your comments confuse me: There is nothing hackish about the
use of @import, and no mixing of languages.
    It sounds as though you are equating @import with Tantek Çelik's Box
Model hack [2], which is something *completely* different. The box model
hack is not pretty at all, and seems to me one of the less desirable ways to
give Netscape 4.x the cold shoulder. In fact, Tantek advertises it
essentially as an IE 5/5.5 hack, not a Netscape hack -- and it is a hack in
the truest sense of the word, as is the use of a slash within a property
keyword.
    The two most elegant ways that I know of to prevent Netscape from
rendering style sheet declarations are the use of @import (which is
standards-compliant), and the use of the disabled attribute on the link or
style element (which is IE-proprietary).

James Aylard

1. http://www.w3.org/TR/REC-CSS2/cascade.html#at-import
2. http://www.tantek.com/CSS/Examples/boxmodelhack.html





More information about the thelist mailing list