The history of CSS hacks
Tantek Çelik’s post Pandora’s Box (Model) of CSS Hacks And Other Good Intentions recaptures the history of CSS hacks and filters. In the early days CSS filters were used mainly to completely hide stylesheets from obsolete browsers like Netscape 4. However, once a way of sending one value to Internet Explorer 5.x for Windows and another to browsers that support the W3C box model was discovered, things changed:
Once said Pandora’s Box was opened, it didn’t take long for the notion that hacking CSS was a “good idea” to spread far and wide in the web design and development community
Tantek goes on to urge developers to really think things through and try to find another solution before resorting to CSS hacks:
Use CSS hacks and filters sparingly (and only as needed) to get non-compliant obsolete/abandoned browsers to comply to your presentational wishes.
Another very important message in Tantek’s post is aimed at browser manufacturers:
CSS2(.1) doesn’t say you can implement part of the spec. You’re supposed to implement the whole spec in the first place.
Wouldn’t it be great if all browser manufacturers could agree on that, and implement the whole CSS 2.1 spec properly and without bugs? Not very likely, but one can always hope…
Until then, I’m going to continue trying my hardest to avoid sending different CSS to different browsers.
- Previous post: Accessible DHTML: two different approaches
- Next post: Elements of Typographic Style for the Web