引入IE11企业模式是为了在IE11中模拟IE8,包括它的用户代理和ActiveX,但是IE条件语句,但是企业模式下的IE11不支持IE条件语句,这本应在IE11企业模式中支持,因为我们大多数人都喜欢使用IE8的条件div编码的css,其中CSS3 prop不受支持。
但在IE10 The conditional statement is removed from IE10 IE8文档模式下,此条件语句有效,请参见下面的屏幕截图。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style>
body{font-size:16px}
#colorRed{color:red}
</style>
</head>
<body>
<!--[if IE 8]><div id="colorRed">I am in IE8, cond statement working</div><![endif]-->
<div class="colorGreen">Hello World!</div>
</body>
</html>
预期结果:它应该已显示colorRed分区,但它未处于企业模式。
理想的情况是引入企业模式来模拟IE8中的一切,但是这个功能缺失了,我已经在这个SO post中讨论了文档模式,但没有讨论企业模式,在这里我测试了企业模式相同的结果。这方面的任何更新,我的IE版本是
提前感谢您的帮助。
发布于 2015-03-14 00:30:18
我建议尝试使用我之前找到的简单的条件<!--[if IE ]>
- as suggested in this article。
我还建议你使用modern.ie免费提供的虚拟机,因为IE仿真在最近的版本中一直是出了名的不可靠!
https://stackoverflow.com/questions/29036401
复制相似问题