From: Thomas Hurst Date: 2002-03-21T04:16:11+09:00 Subject: Re: [OT] web standars (was: web templating for static sites?) * Jason Voegele (jason@jvoegele.com) wrote: > I apologize for continuing an off-topic thread, but I've heard several > people mention this @import trick and I'd like to know what it is. It's just an extension of modularising your CSS; @import url(layout-stuff-that-breaks-ns4.css); Alternatively you do what the W3C Core Styles (http://www.w3.org/StyleSheets/Core/); generate them dynamically based on the user agent (and hope the ua isn't spoofed; something Opera does by default (which badly skews usage stats, *grumble*)). To do this, you need to remember not just to stick with the default headers (especially not PHP's, which disables caching entirely; not nice for stylesheets); check out the HTTP spec and the headers the core styles put out. It's possible to do some more advanced browser fingerprinting, actually; Opera, for instance, has a fairly unique Accept-Encoding: header no matter what it spoofs as (by default it pretends to be IE5 pretending to be Mozilla 4 iirc, heh), which makes it easy to seperate from IE. Maybe a little project for someone; something like phpSniff (http://phpsniff.sourceforge.net/) which uses browser fingerprinting and parses out Accept-(Language|Content|Encoding). > Could someone please explain this to me, preferably with examples? At > least one page on my site does not render correctly in Netscape or > Mozilla due to its heavy reliance on CSS, and I'd like to fix this. Er, if it doesn't render correctly in Mozilla it's either a bug you need to fix or a bug they need to fix. The only workaround I'm aware of for Mozilla is to generate CSS dynamically. -- Thomas 'Freaky' Hurst - freaky@aagh.net - http://www.aagh.net/ - Mommy, what happens to your files when you die?