为什么 Internet Explorer 11 无法识别 HTML 中的条件注释?现在不支持了吗?

2024-01-18

我想在不同的浏览器上显示不同的内容。我使用了 Internet Explorer 11 和 Google Chrome 39。但是,在 Internet Explorer 和所有其他浏览器中,都会显示“不是 Internet Explorer”。代码有问题吗?我看到以下代码作为对相同问题之一的回答question https://stackoverflow.com/questions/19805189/html-ie-conditional-statement-not-working-with-chrome-firefox,那么为什么现在不起作用呢?

code:

<!DOCTYPE html>
<html>
<body>

<!--[if (IE)]><p>This is Internet Explorer</p><![endif]-->

<!--[if !(IE)]><!--> Not Internet Explorer <!--<![endif]-->

</body>
</html>

微软放弃有条件评论 http://msdn.microsoft.com/en-us/library/ie/hh801214%28v=vs.85%29.aspx在 Internet Explorer 版本 10 中。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么 Internet Explorer 11 无法识别 HTML 中的条件注释?现在不支持了吗? 的相关文章