Recently had a project that required IE6 compatibility,  it was annoying, but wasn’t all that difficult. There are hundreds of hacks out there to target all kinds of browser flaws, most of said flaws have been ironed out, but IE6 is just a big problem. I did my research on it, and apparently in August of this year there were still 6.7% of users using it. That’s 67 out of 1000 visitors, which counts for something. My question is, is that developers testing in IE6 being counted as users? A few screen shots of my ordeal are below.

First,  how it’s supposed to look:
Next, we have IE6:
And now IE7:

As you can see, things became just slightly distorted in different versions of IE. This, believe it or not, was easily sorted out without hacks. I used conditional comments that only target IE, these are available from Microsoft at: http://msdn.microsoft.com/en-us/library/ms537512%28VS.85%29.aspx . Or, you can check out these examples, they are placed in the head of the page:

<link rel=”stylesheet” type=”text/css” href=”css/default.css” media=”screen” />
<!–[if IE 7]>
<link rel=”stylesheet” type=”text/css” href=”css/ie7.css” media=”screen” />
<![endif]–>
<!–[if lt IE 7]>
<link rel=”stylesheet” type=”text/css” href=”css/ie6.css” media=”screen” />
<![endif]–>

As you can see, you put your main CSS file first, then you add in specific CSS files for each version of IE. Only IE sees these, and they do not invalidate your page.

In my experience, probably only about 50% of developers know about this. I say that because a lot have no clue they should be targeting IE6, they only test in latest browser versions, and the others still use hacks. I personally own a hack book that’s around 200 pages, and not once are conditional comments mentioned, probably because it would reduce the book to about 30 or so pages.

In the end, IE6 displayed the page better than IE7, believe it or not.