How we do IE Hacks

We recently changed the way we do IE hacks at Soupgiant. For years we used conditional comments to load separate CSS files.

For a few sites, we used Paul Irish’s conditional HTML classes hacks. Without workarounds, this puts IE in compatibility mode.

Recently, we decided to go back to attribute hacks.

Using LESS CSS and compiling with less.app, it’s possible to store the hacks in a single location and remove them once the browsers die.

The hacks we use are:

/* IE6 */ 
#something {
  _color: blue;
}

/* IE6, IE7 */
#something { 
  *color: blue;
}

Around the time we switched, Mathias Bynens wrote a post detailing much the same conclusions we reached. I won’t rehash them here.

Excuse the dull and highly unfashionable post. It’s main purpose is so we can go to bigredtin.com/iehacks when memory fails us. We use this blog a resource.

By Peter Wilson

Peter has worked on the web for twenty years on everything from table based layouts in the 90s to enterprise grade CMS development. Peter’s a big fan of musical theatre and often encourages his industry colleagues to join him for a show or two in New York or in the West End.