Much has been written about CSS since it was first introduced many years ago. The expressive power apparent by reading the specifications themselves can bring many a web designer to her knees. Designs once only possible (if at all) using nightmarish tricks like nested tables and invisible GIFs are now in the grasp of someone who still wants the code to be readable. And yet, not all is so wonderful in real life.
Perhaps the biggest problem is that specification precedes implementation. That is, we have a group of people known as the W3C publishing recommendations on how browsers (or more generally, user agents) should implement things. There are a couple of problems with this. The first is that there’s something of a disconnect—such as the old vertical centering problem. At least with up to CSS2, vertically centering something can be a difficult task, relying on specific knowledge of the size of the relevant elements, while with tables, the task is trivial.
The other problem, and definitely a more serious one, is that users use a number of browsers, and not a single one of them implements the whole of CSS2, and I can’t imagine the situation will improve much when CSS3 is finalized. The net result of this is that web designers who don’t want to target a particular version of a particular browser are left with a couple of possibilities:
Lowest Common Denominator
By far the most common solution, most webmasters seem to cater to the lowest common denominator, using a subset of CSS that works in all browsers. Accompanying this is a series of tricks and hacks to coax browsers like Internet Explorer to do things the same as other browsers. This isn’t to say that the others are even consistent with each other. In short, it’s a mess, and designers really miss out on some of the neatest features of CSS.
Different Browser? Different Style Sheet.
I haven’t noticed this solution very often, though it should, in practice, be fairly easy to implement using a bit of server-side scripting. The biggest problem here is that different users may see a slightly different version of the site, and when one day they change browsers, the interface may change leading to confusion. Nonetheless, it does offer the most possibility, especially for the most compliant browsers.
We can only hope that this situation will improve soon, or else some of the real promise of CSS will never be truly realized. With that said, what solutions do you have to the cross-browser compatibility conundrum?