gpt4 book ai didi

internet-explorer - 在 HTML5 中使用 IE 特定元标记是否合法?

转载 作者:太空狗 更新时间:2023-10-29 13:42:23 26 4
gpt4 key购买 nike

我一直在尝试验证 header 中包含以下两行的 html5 文档:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="imagetoolbar" content="no" />

整个文档验证非常好,但是这两行是 IE 特定的,使页面无效。

我的问题:这些元标记是否有合法的 HTML5 语法?我非常希望我的代码是有效的,但是这些标签不能被取消。

最佳答案

根据您对服务器/服务器端代码的访问权限,您可以将 X-UA-Compatible 作为 header 提供。我不确定是否可以对 imagetoolbar 执行相同的操作。

编辑:您的另一个选择是条件注释:

<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="imagetoolbar" content="no" />
<![endif]-->

关于internet-explorer - 在 HTML5 中使用 IE 特定元标记是否合法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2977590/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com