微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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作为替代.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐