CSS hacks/unhacks: using IE conditional code to solve CSS problems

Working on a recent layout, I was finally confronted with the need to have an IE CSS hack. I hate hacks, because they often break with browser updates and aren’t easily remembered. So I avoid them as much as possible. However, I finally succumbed to having to use a hack… except the method I use is not a hack so much as relying on IE functionality. My designs typically can be made to work in Opera, Mozilla/Firefox and Safari browsers very easily, and then occasionally take some head pounding to get to work for IE (first windows then mac). While some might suggest designing for IE first, that is not desirable as I use a mac to develop on, although I do use a PC at work. Also, when resolving a design for IE first, it is tempting to not check the others, as IE is still the browser of the masses. Working with Safari, Mozilla first gets the less numerous browsers out of the way. The additional nightmare of IE is that you have to deal with the subversions, 5.0 does not work the same as 5.5, which is not the same as 6.x (don’t mention 4.x browsers).

Continue reading