Search
  • Conditional Comments

    Date: Sep 7, 2010  |  Categories: Html  |  Written By: Mike Ballan  

It seems like every time i build a website i always have the same problem and that problem is Internet Explorer 5 & 6, and no matter how many times i try to forget that they ever exsits i get someone using windows 98 running IE 5.5 wanting a site that has JQuery or any other of the latest things were putting into our website and this is where i thought i would share “Conditional Comments”

Now Conditional Comments only work on Explorer on Windows which makes them perfect for making IE do what you want it to do. They are supported from Explorer 5 onwards, and it is even possible to distinguish between 5.0, 5.5 and 6.0. Below is a list of all the different ways you can use these comments.

<!--[if IE]>
According to the conditional comment this is Internet Explorer<br />
<![endif]-->

<!--[if IE 5]>
According to the conditional comment this is Internet Explorer 5<br />
<![endif]-->

<!--[if IE 5.0]>
According to the conditional comment this is Internet Explorer 5.0<br />
<![endif]-->

<!--[if IE 5.5]>
According to the conditional comment this is Internet Explorer 5.5<br />
<![endif]-->

<!--[if IE 6]>
According to the conditional comment this is Internet Explorer 6<br />
<![endif]-->

<!--[if IE 7]>
According to the conditional comment this is Internet Explorer 7<br />
<![endif]-->

<!--[if gte IE 5]>
According to the conditional comment this is Internet Explorer 5 and up<br />
<![endif]-->

<!--[if lt IE 6]>
According to the conditional comment this is Internet Explorer lower than 6<br />
<![endif]-->

<!--[if lte IE 5.5]>
According to the conditional comment this is Internet Explorer lower or equal to 5.5<br />
<![endif]-->

<!--[if gt IE 6]>
According to the conditional comment this is Internet Explorer greater than 6<br />
<![endif]-->


Leave a Reply

Back to Top