The very first article I wrote on this blog, back in July 2006, was titled Goodbye hacks. Hello conditional comments. In that post I discussed how conditional comments could be used to feed different stylesheets to older version of Internet Explorer, smoothing differences between browser rendering engines without resorting to CSS hacks.
Conditional comments have provided a great stopgap measure while we wait for obsolete versions of IE to fall into disuse, but as the market share of IE6 and IE7 has dwindled I’ve found myself relying on them less and less. In fact, I can’t remember the last time I resorted to a separate stylesheet to make an old browser behave.
Last week Microsoft announced that support for conditional comments will be dropped from version 10 of Internet Explorer. Like other modern browsers IE10 will treat conditional comments just like regular HTML comments, and ignore them. This is a very encouraging sign, since it means that Microsoft are confidant that IE’s support for web standards has reached a level where a standards compliant website ought to “just work” across all modern web browsers, without having to make special allowances for legacy rendering engines.
Of course, conditional comments will continue to be recognised by older versions of IE, but with IE6 and IE7 ready to disappear off the radar the time is clearly right for conditional comments to be put out to pasture. Goodbye conditional comments.Tweet