CSS hacks are harmful

CSS hacks should be avoided wherever and whenever it's possible. They make your CSS code harder to read and to maintain. Since the overwhelming majority of CSS hacks are targeted to older versions of Internet Explorer (mainly 7 and 6), the true question that they arise is when you should support these browsers or not. Let me put it in this way: if we extend the concept of backward compatibility to its maximum, then we should be able to create web sites that look perfect even in Netscape 4 or Mosaic. Now tell me: how much time will be required to fulfill this task? How much money of your budget are you going to spend?

The true meaning of backward compatibility is to create web sites that degrade gracefully in older browsers. So if you don't use CSS hacks, your web sites will simply degrade gracefully in older browsers. No damage to the users, no time or extra money spent by your agency. On the contrary, looking back to your CSS after a while you'll probably wonder about the meaning of this strange CSS rule that starts with an underscore, or this height: 100% or height: 1% repeated over and over again throughout your style sheet. Sure, you can use comments to straighten things up, but what's the ultimate purpose of this?

You should speak frankly to your clients and tell them that the new trends of the web are getting rid of older browsers: Google and all major companies are getting rid of older browsers, new rising companies are getting rid of older browsers, users are getting rid of older browsers, so why are you still hanging on them?

Speaking frankly to your clients can only help them to exploit better the new opportunities of the web. Using CSS hacks to make your web sites look "perfect" in older browsers can only make your clients spend more money for nothing.

This entry was posted in by Gabriele Romanato. Bookmark the permalink.

Leave a Reply

Note: Only a member of this blog may post a comment.