HTML IE条件语句:不适用于Chrome / Firefox [英] HTML IE conditional statement: Not working with Chrome/Firefox
问题描述
<! - [if(IE)]><< ; - >我是IE<! - <![endif] - >
<! - [if!(IE)]><! - >我不是,即<! - <![endif] - >
在IE中查看时,它正确地显示我是IE
在Chrome / Firefox中查看时,它错误地显示我是IE,我不是IE而不是我不是IE。 =http://jsfiddle.net/Hgx97/ =noreferrer> http://jsfiddle.net/Hgx97/
您在第一行中错误地终止了IE条件注释,所以其他浏览器将会看到分隔符之间的内容(您还可以看到第一行的文本如何突出显示为黑色,不是你想要的):
<! - [if(IE)]>我是IE<![endif] - >
<! - [if!(IE)]><! - >我不是,即<! - <![endif] - >
第二行是正确的,因为您想将内容展示给非IE浏览器。
I have the following in my html document.
<!--[if (IE)]><!--> i am IE <!--<![endif]-->
<!--[if !(IE)]><!--> i am not ie <!--<![endif]-->
When viewed in IE it properly says "i am IE"
When viewed in Chrome/Firefox it incorrectly says "i am IE i am not ie" instead of "i am not IE"
You're incorrectly terminating the IE conditional comments on the first line, so other browsers will see the content between the delimiters (you can also see how the text is highlighted black on the first line, which is not what you want):
<!--[if (IE)]> i am IE <![endif]-->
<!--[if !(IE)]><!--> i am not ie <!--<![endif]-->
The second line is correct since you want to show that content to non-IE browsers.
这篇关于HTML IE条件语句:不适用于Chrome / Firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!