IE 8 文档模式 -

发布于 2024-09-18 14:22:08 字数 170 浏览 1 评论 0 原文

有哪些优点和缺点

<meta http-equiv="x-ua-compatible" content="IE=8">

添加到网站 。我希望 IE 8 在 IE 8 Doc 模式下呈现,以便跨浏览器的样式更具凝聚力。我只是担心添加这个的负面后果。

What are the pros and cons of adding

<meta http-equiv="x-ua-compatible" content="IE=8">

to a website. I would like IE 8 to render in the IE 8 Doc mode so styles are more cohesive across browsers. I am just worried about negative consequences of adding this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

糖果控 2024-09-25 14:22:08

如果您提供适当的 DOCTYPE,例如 ,IE8 将以 IE8 标准模式呈现。在这种情况下,不需要 来强制它。

添加它的唯一后果是即将发布的 IE9 将以 IE8 兼容模式呈现页面。但是,如果您出于某种原因确实想添加它,并且仍将 IE9 保持在自己的标准模式下,您可以使用条件注释来解决它,

<!--[if IE 8]>
  <meta http-equiv="x-ua-compatible" content="IE=8">
<![endif]-->

但我真的不认为添加它有什么意义。只需使用 即可确保所有浏览器(甚至包括 IE6)中的标准模式。

IE8 will render in IE8 standards mode if you provide an appropriate DOCTYPE, like <!DOCTYPE html>. <meta http-equiv="x-ua-compatible" content="IE=8"> is unneeded to force it in this case.

The only consequence of adding it though would be that the soon to be released IE9 will render the page in IE8 compatibility mode. But if you really really wanted to add it for some reason, and still keep IE9 in its own standards mode you can work around it with a conditional comment

<!--[if IE 8]>
  <meta http-equiv="x-ua-compatible" content="IE=8">
<![endif]-->

I just really don't see a point to adding it though. Just have <!DOCTYPE html> that will ensure standards mode in ALL browsers (including even IE6).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文