W3C home > Mailing lists > Public > www-style@w3.org > October 2003

Re: Proposal - browser specific CSS

From: J. King <mtknight@dark-phantasy.com>
Date: Wed, 15 Oct 2003 13:49:02 -0400
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <oprw3if0nak4suho@mail.dark-phantasy.com>

On Wed, 15 Oct 2003 14:08:55 +0200, Marc <manarth@zioncore.com> wrote:

> Perhaps the type attribue should be redefined:
>     <link rel="stylesheet" href="style.css" type="text/css" 
> media="screen" />
>     <link rel="stylesheet" href="style.css" type="text/css3" 
> media="screen" />
>     <link rel="stylesheet" href="style.css" type="text/css4" 
> media="screen" />
>
> There is precedent: the HTML dtd (doctype declaration) specifies the 
> version of HTML is being sent, so why not do the same for CSS?

Yes, there is precedence for this sort of thing, but what you're proposing 
is registering a new MIME type each time the Working Group issues a new 
version of CSS.  This is certainly not the best way to do it.

One of the original design goals of CSS is that agents with less 
capabilities than you intend will still display the document acceptably.  
Though this generally hasn't worked terribly well in practice, the 
principle is sound and does apply to a great many CSS3 properties that are 
being proposed.

> Adding a deliberate 'Exclude' statement into CSS would allow developers 
> to deliberately introduce different style elements depending on what 
> browser was used.  This avoids 'dirty hacks' like the example above; 
> allowing developers to cater for different browsers' implementations of 
> CSS in a more meaningful and deliberate fashion.

Client- and server-side scripting will already do this (more or less 
poorly), and it's doubtful that any similarly-intentioned implementation 
in CSS would work any better.  Use what's avalaible if you must, but 
browser sniffing, as it's called should be discouraged, not enshrined in 
the specification.

-- 
J. King
mailto:mtknight@dark-phantasy.com
http://dark-phantasy.com/
http://snap.dark-phantasy.com
Received on Wednesday, 15 October 2003 13:47:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:24 GMT