Internet Explorer 7 and * html

When Internet Explorer 7 is released, probably later this year, it looks like one long-standing CSS selector bug in IE will be fixed: the Star html Selector Bug, also known as the Tan hack. Since the bug has been used by many web developers to target specific CSS rules at Internet Explorer as a way of working around various CSS bugs in the browser, some are worried that Microsoft fixing the bug in IE 7 may cause developers a lot of extra work.

If the CSS problems that authors have used the Tan hack to provide workarounds for still remain, there will indeed be trouble. But since Microsoft are also saying they will fix a lot of rendering problems related to CSS in IE 7 there is a reasonable chance that the problems that caused developers to use the * html hack have also been fixed. In that case all should be fine.

But we don't quite know yet, and there are those who, like John Gallant of Position Is Everything, are opposed to the Star html selector bug being fixed. Microsoft's Internet Explorer team, on the other hand, advise developers to completely stop using CSS hacks and instead use conditional comments when Internet Explorer needs different CSS.

Molly E. Holzschlag has written a summary of the Star html discussion in Star HTML and Microsoft IE7 and points to John Gallant's article that explains why he believes that the star HTML bug should not be fixed in IE 7: Wither the Star-HTML hack?. Accompanying the article is a poll where developers can vote for how they believe the removal of the star-HTML hack will affect them. Comments on the poll can be made at in star html poll comments.

Phew. That's a whole lot of noise for a CSS hack, but it's good if we can get everything fully sorted out before IE 7 is released.

Personally, I prefer using CSS hacks as little as possible, and only as a last resort. I see many developers sprinkle CSS hacks all over their CSS files without first attempting to find a hack-free way of solving the problem, which is often possible. When I do need to use CSS rules targeted at IE/Win, I also tend to use conditional comments instead of CSS hacks.

Posted on January 5, 2006 in Quicklinks, Browsers, CSS