html – 如果条件语句不能与IE 11一起使用

前端之家收集整理的这篇文章主要介绍了html – 如果条件语句不能与IE 11一起使用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
参见英文答案 > IF IE conditionals not working5个
我正在使用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作为替代.

原文链接:https://www.f2er.com/html/227614.html

猜你在找的HTML相关文章