If you run into a major roadblock, Rafael Lima's CSS Browser Selector could be your saving grace. A tiny bit of Javascript (less than 1kb!) determines the user's browser and creates an accordingly-named class. From there, it's simply a matter of applying the styles that were written for that particular browser. For example:
.ie .example {
background-color: yellow
}
.gecko .example {
background-color: gray
}
.opera .example {
background-color: green
}
.konqueror .example {
background-color: blue
}
.webkit .example {
background-color: black
}
.example {
width: 100px;
height: 100px;
background-color: brown;
} The colored box on the CSS Browser Selector page gets the point across better than anything else, though. Open the page in a few different browsers to see for yourself.








1. Brilliant! This could be a real saver!
Posted at 10:19AM on Jul 26th 2006 by Superautomatic