Re: [css3] [css21] browser specific CSS

On 3/31/2011 10:53 PM, Alan Gresley wrote:
>> 1) Not all browsers can be easily differentiated with the various known
>> hacks. Searching for and/or inventing such hacks may bring a feeling of
>> accomplishment, but are largely a waste of programming resources. Some
>> of the hack sites I've visited point out that certain browsers cannot be
>> easily differentiated, but do have variant CSS implementations.
>
>
> I strongly disagree with the use of any browser hacks. From all my
> experience with coding CSS and HTML, any browser bugs relating to CSS
> implementation that do occur can not be fixed with hacks. The only fix
> is the rearrange the HTML or try simpler CSS styling.


Hi Alan,

Thanks for your response.  I too dislike browser hacks, but with the 
state of the browser art today, and the limitation of being unable to 
detect a browser in CSS, there are many web sites resorting to hacks 
rather than living with the tiny subset of CSS that is actually 
available and compatible in the browsers in use today.

Your suggested fix works for simple things, but today's web sites want 
to be complex things, and what can be done with CSS is way easier than 
coding everything in Javascript (which is often disabled anyway), so the 
limits of the extant CSS implementations are being pushed... if they 
weren't, all you fine folks wouldn't be working on newer versions of CSS!

The state of CSS seems unlikely to converge to a uniform, 
fully-implemented, fully-conformant in browsers that are in use for many 
years, both because of enhancements and revisions to the standard, and 
phased and buggy implementations of various pieces of the standard.

Sadly, all software has bugs, and browsers and their CSS implementations 
are unlikely to suddenly become perfect.  And even when bugs are fixed, 
not all users upgrade, so the bugs persist in the wild for years.

Hence, providing a quick and easy method of discriminating between 
browser brands and versions in CSS would be a real service to web site 
developers that want to push the state of the art, yet have no control 
over their users' choices of browser brands and versions.

Those that wish to live with functional subset of CSS implemented in all 
browsers actively in use on the WWW will wind up with rather bland 
sites, or lots of Javascript, or both.

For my personal web sites, I've chosen to mostly be bland, but that 
doesn't appeal to customers. And even with blandness, I've discovered 
enough differences in browsers, that I finally decided to code for 
Firefox, use Javascript to detect which browser, and have a few tweaks 
for (mostly) IE (and not just IE 6... some of the differences I've found 
are still in IE9), but also Opera and Chrome.  So if users of 
non-Firefox browsers turn off Javascript, certain parts of my sites look 
terrible.  Firefox doesn't need Javascript at all to use my sites, but 
others do... only so I can detect the browser and use different CSS rules.

This is my personal experience, but other web developers I've discussed 
this with have mentioned similar issues.  They haven't all made the 
exact choices I have for solutions, but all have agreed it would be 
great to have browser detection in CSS.

I'll be very surprised if this issue hasn't come up before within the 
working group, but after recently discovering the technique I started 
with thread by referencing, I realized how beneficial such would be (and 
is, as I've applied it now to several sites), so wanted to be sure to 
add my support for the concept, or, on the off chance that it hadn't 
come up before, to bring it up.

Received on Friday, 1 April 2011 06:39:02 UTC