W3C home > Mailing lists > Public > www-style@w3.org > March 2011

[css3] [css21] browser specific CSS

From: Glenn Linderman <v+html@g.nevcal.com>
Date: Fri, 25 Mar 2011 02:50:53 -0700
To: www-style@w3.org
Message-Id: <20110325025053.A4E3DE50.v+html@g.nevcal.com>
So I've just downloaded the latest crop of browsers, IE Opera Chrome and Firefox.

There are still a fair number of differences in the way they do things, and so there is still a need to tweak CSS to compensate.

I dislike the "CSS hacks" and they are insufficient to isolate particular versions of particular browsers.

http://rafael.adm.br/css_browser_selector  is a pretty cool technique which I have enhanced to solve some some issues where IE9 acts differently than the other browsers.  Sadly, it requires JavaScript to be enabled.

While I understand that the goal of standards is to achieve universal conformance, that is a process that takes time and investment, which isn't uniformly applied across all browser suppliers. Hence, I propose that CSS should define a standard way of detecting a particular browser, by common name and version number (at least the first two level of version number).  A result that is at least as usable as rafael's technique, where a particular browser can be specified by name or by name and major version, or by name and major and minor version, and used as part of the selector for various CSS rules.

While I would be delighted if all browsers actually did implement all CSS in the same standard-conforming way, omissions, bugs, and extensions all exist, and have for many years now, and likely will continue to exist.  Hence, a standard that doesn't support the differences by allowing the specific browser to be identified and conditional rules specified for it, is deficient.

I realize that no existing browser, including this latest crop, implements such a standard, nor will the old versions ever be updated to have such a browser identification scheme.  We will be stuck with JavaScript and/or CSS hacks for many years.  But just as Microsoft is attempting to make IE6 die, perhaps eventually such a scheme would be widespread enough to be useful.  I rather expect that would happen long before all browsers are uniform in their CSS implementations.

My revision of Rafael's scheme can be found at http://nevcal.com/cssrequest.js but I have no documentation other than a few added comments at the top of the code.

Thanks for your consideration,
Glenn Linderman
Received on Saturday, 26 March 2011 11:19:17 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:44 UTC