Conditional Comments: Targeting Internet Explorer
Microsoft introduced conditional comments with version 5 of Internet Explorer for Windows, as a way of presenting a richer user experience to users of their browser.
A conditional comment is a HTML comment with a condition structure that evaluates the version of Internet Explorer and compares it to the version number specified within the condition:
lt(e)– version number less than (or equal to)gt(e)– version number greater than (or equal to)- none – equality
!– not
If the condition evaluates to true then the instructions within the comment are executed. In this way code can be targeted toward specific versions of IE (“downlevel-hidden”).
Only IE5+ for Windows understands this structure, so all other browsers treat the contents between the opening and closing comment tags as a comment block and ignore it.
Microsoft also added a “downlevel-revealed” conditional comment that ‘lesser’ browsers would not ignore:
But this is not a properly formed HTML comment, and it will prevent pages from validating.
Endnote
Although Microsoft introduced conditional comments as a way of delivering a richer user experience to IE, many web designers/developers now use them as a way of targeting IE's shortcomings.
It is therefore ironic that the Microsoft documentation refers to browsers that do not understand these comments as being ‘down-level’. That may have been true when IE5 introduced conditional comments into the web developer's toolbox, but it's hardly the case now.