To hack or not to hack

That is the question. And there is a lot of debate on the subject. Me, I can’t get around using hacks with the complicated designs I have to code. I’ve found that IE7, although better than IE6 by a long shot as far as standards compliance goes, still has some of the same issues as IE6.

So this is what I do. I link in an IE hacks stylesheet via conditional comments (this is what Microsoft recommends).

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="iehacks.css" />
<![endif]-->

Then I put any hacks that apply to both IE browsers into that stylesheet. No fancy stuff needed. If I need to make an IE6-only hack, I use the good ol’ * html hack.

So, if we launch our page in IE7, it loads the stylesheet and only picks up the non-star html hacks. If we launch our page in IE6, it picks up all the hacks.

Works for me.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s