Internet Explorer Tan All Articles
Features

The Secret Handshake in the Markup: How <!--[if IE]> Taught a Generation to Whisper

By Internet Explorer Tan Features
The Secret Handshake in the Markup: How <!--[if IE]> Taught a Generation to Whisper

Photo: Unknown authorUnknown author, CC0, via Wikimedia Commons

The first time you saw it, you assumed someone had fallen asleep on the keyboard. Angle brackets inside a comment, a bracket-and-percent sandwich, a lonely endif sitting at the bottom of a style sheet like a forgotten coat check ticket. It looked less like code and more like a ransom note assembled from HTML scraps.

Then a senior developer leaned over your shoulder, pointed at the screen, and delivered the sentence that defined an era of American web work: 'That's for IE. Leave it alone.'

Conditional comments were the web's most passive-aggressive love letter to a browser. A way to insult Internet Explorer in public while hiding the apology from everyone else. And in 2026, long after the browser was formally retired with a commemorative blog post and a sad little loading spinner graphic, their fingerprints are still smeared across enterprise codebases that nobody has the budget to touch.

A Comment That Wasn't Actually a Comment

Here is the trick, and it deserves respect: Internet Explorer's HTML parser had a special case. If the contents of a comment matched a specific pattern, IE would evaluate the condition, and if it passed, it would treat the contents as live markup. Every other browser on the planet saw a comment and did what browsers do with comments, which is absolutely nothing, forever, without complaint.

<!--[if IE 6]>
<link rel="stylesheet" href="/css/ie6-suffering.css">
<![endif]-->

Firefox, Safari, Netscape, Opera, and eventually Chrome: blank stares all around. Internet Explorer 6: a whole extra style sheet, fetched, parsed, applied. One file, two audiences, zero server-side gymnastics. No user-agent string parsing, no JavaScript sniffing, no cookies, no redirects. Just a syntax hack that happened to be precisely the right amount of wrong.

The condition language was tiny and delightful. lt, lte, gt, gte, version numbers, and — because the late nineties were a lawless place — the occasional IE 5.5. [if lt IE 9] became a mantra recited in code reviews. [if IE] was the blunt instrument. [if !IE] was the trap that ate an afternoon of your life.

The Two Flavors Nobody Could Ever Remember

There was the downlevel-hidden version, which is the one everybody used, and then there was the downlevel-revealed version — the one for showing content to browsers that were not IE. That one required you to break the comment apart: <!--[if !IE]>--> on the front and <!--<![endif]--> on the back.

That construction is not a valid comment. Validators clutched their pearls. XML parsers occasionally choked. A few content management systems rendered the whole block twice, which produced some memorably surreal support tickets. But it worked, which is the only review criterion that has ever really mattered.

The ie.css Filing Cabinet

Somewhere in every project from roughly 2005 to 2015 sat a folder that told the whole story of a team's ambition and its compromises at the same time:

/css
  main.css
  layout.css
  print.css
  ie.css
  ie7.css
  ie6.css

The seventh circle of that folder held the true confession files. ie6.css was rarely long, but every line in it had a story, usually involving hasLayout or a star hack or a zoom: 1 applied with the grimace of a person taking medicine.

And then there was the snippet that lived at the top of every HTML document in America for about five years, copied with religious fidelity:

<!--[if lt IE 9]>
<script src="html5shiv.js"></script>
<![endif]-->

You did not know what a shiv was. You did not know what a shim was either. You pasted it, it worked, and the page no longer collapsed like a folding chair when you used a section tag.

Copy-Paste Folklore and the Honesty Problem

Conditional comments spread the way all good hacks spread: through Stack Overflow answers quoting earlier Stack Overflow answers, through blog posts written in 2007 and still ranked first in search results, through a coworker's zip file named final_FINAL_css. They became a secret handshake. You could spot a developer who had shipped a site between 2006 and 2013 by the way their eye twitched at the phrase 'downlevel-revealed.'

But here is what made them genuinely better than the hacks they replaced. A * html selector looked like a mistake. A _height property looked like a typo. Conditional comments looked like a decision. They were self-documenting in a way that nothing else in the toolbox was. You could open a file eight years later, see a block labeled [if lte IE 7], and immediately understand both what it did and who was responsible for the misery.

The Impossible Stakeholder Conversation

Trying to explain conditional comments to a project manager was a rite of passage. The dialogue went roughly like this: 'Why is there commented-out code shipping to production?' 'It's not commented out for everyone.' 'So it's commented out.' 'It's commented out for everyone except the browser that needs it.' A long pause. A meeting scheduled. A slide deck created.

The other classic was the well-meaning cleanup. Someone joins the team, sees a file full of mysterious bracket soup, deletes it as obvious cruft, and ships a release that makes the intranet look like a ransom note. QA finds out two days later when accounting files a ticket about the timesheet page.

What We Actually Traded Away

IE9 dropped conditional comments in standards mode. IE10 confirmed it. In their place came Modernizr, then @supports, then a whole culture of not targeting browsers at all, which is objectively the correct philosophy and which nobody who lived through 2008 will ever fully trust.

The trade was good. It just wasn't free. What disappeared along with the brackets was the written record — the in-the-markup note that said this exists for a reason, and here is the reason. Today our CSS gets rewritten by a build step, our polyfills arrive silently, our transpiler hums in the background, and almost nobody writes a comment explaining any of it. Conditional comments were documentation shaped like a hack. That is a strange thing to miss, but here we are.

And the kicker, the eternal kicker: IE mode in Edge still honors them. So somewhere in a Fortune 500 right now, in a browser that officially does not exist, running on a policy that officially does not need to exist, a conditional comment written in 2009 is quietly doing its job. Retirement, it turns out, is mostly a state of mind.