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

Lachlan Cannon tiedefenderdelta6 at yahoo.com
Thu Jan 17 22:46:28 CST 2002


--- MRC <webmaster at equilon-mrc.com> wrote:
> Andrew,
...
> 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).


This was in response to me asking if anyone had noticed
that when you use Tantek's hack that NN4.x doesn't use the
stylesheet at all.

I only call @import a 'hack', in that people use it to
exclude stylesheets from NN4.. not what it's intended for.
@import really belongs in stylesheets, not in your html,
and I find this way, I can get rid of two birds with one
stone (hiding values form IE5.x, and excluding NN4), while
excluding styles from the document - much cleaner.

Furthermore, the stylesheet that NN does still have to
download is only 1.81 kb at the moment, and even when I
roll the site into production and need to add things, I
can't see it growing much bigger.

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/




More information about the thelist mailing list