(!IE) Problems with Blocking Code from IE
I have (once again) been enhancing m开发者_JAVA百科y template for a school site. However, I have run into another problem. I have noticed that the navigation bar does not render properly in any Internet Explorer version prior to IE9 (to be expected). I had seen the use of the !IE tag around the web and tried replicating it on my design. However, once implemented, every browser stopped showing that piece of code.
<!--[if !IE]>
<li><p> </p></li>
<li><img src="vp-global-logo.gif" />
<![endif]-->
I also tried:
<!--[if gte IE 9]>
<li><p> </p></li>
<li><img src="vp-global-logo.gif" />
<![endif]-->
How would I get this to work? Is there any alternative method without making the site too slow?
You need to terminate the conditional comments with a special syntax:
<!--[if !IE]><!-->
<li><p> </p></li>
<li><img src="vp-global-logo.gif" />
<!--<![endif]-->
This prevents IE from displaying the HTML while other browsers get to see it, treating the if and else as regular HTML comments.
You're commenting out the list items, try changing your code to this:
<!--[if gte IE 9]--><!-->
<li><p> </p></li>
<li><img src="vp-global-logo.gif" />
<!--><![endif]-->
精彩评论