How do I make an "else" in an IE HTML conditional?

TIMEX picture TIMEX · Jul 19, 2011 · Viewed 85.9k times · Source
<!--[if lt IE 9]>
    This is less then IE9
ELSE
    this is all browsers: firefox, chrome, etc.
<![endif]-->

How do I do this in my HTML? I want to do an "else" ...

Answer

cwallenpoole picture cwallenpoole · Jul 19, 2011

You're not looking for an else, you're looking for <![if !IE]> <something or other> <!--[endif]> (note that this is not a comment).

<!--[if IE]>
   You're using IE!
<![endif]-->
<![if !IE]>
   You're using something else!
<![endif]>

You can find documentation on the conditional comments here.