About Conditional Comments

Seems almost like a browser-war era relic, but IE5+ recognizes two special forms of conditional comments: if you start a comment with <!–[if …]> and end it with <![endif]–> then IE5+ will evaluate the condition and display the html between the two pseudo-tags. To hide things from IE5+, use <![if …]> to start and <![endif]> to end hiding. Sample:

You are not using IE5

Which should tell you whether or not you are using IE5 (in case you were wondering). The only reasonable use I can come up with for this is if you have the unenviable task of writing “how to use IE even if you might be using IE4” pages, and you aren’t even allowed to require the use of Javascript, so you can’t do a browser sniffer. But useful or not, it’s interesting, and that’s enough for me.
[msdn ferreting by scottandrew]

Comments

No comments yet.

Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.