<分区>
我使用的是 IE 11 版本。 是否有任何其他解决方案可以执行以下操作:
当我尝试在 html webapge 中使用条件 IE 子句时,没有任何反应。 谁能帮我调试这个问题。
<!--[if IE]>
<a href="next-page.php" class="start-button">CLICK ME</a>
<![endif]-->
<分区>
我使用的是 IE 11 版本。 是否有任何其他解决方案可以执行以下操作:
当我尝试在 html webapge 中使用条件 IE 子句时,没有任何反应。 谁能帮我调试这个问题。
<!--[if IE]>
<a href="next-page.php" class="start-button">CLICK ME</a>
<![endif]-->
最佳答案
Conditional statements do not work in IE 10 or 11
Support for conditional comments has been removed in Internet Explorer 10 standards and quirks modes for improved interoperability and compliance with HTML5. This means that Conditional Comments are now treated as regular comments, just like in other browsers. This change can impact pages written exclusively for Windows Internet Explorer or pages that use browser sniffing to alter their behavior in Internet Explorer.
如果您真的只需要在那些浏览器上执行代码,而您可能不应该这样做,您可以使用 JavaScript 来做一些事情 feature detection作为替代品。
关于html - if 条件语句不适用于 IE 11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27470022/