html - 在 IE10 iframe 中强制 IE8 仿真

标签 html internet-explorer iframe internet-explorer-10 x-ua-compatible

我公司最近从 IE8 迁移到 IE10 我需要模拟 IE8 以便在 IE10 中正确显示页面

这是我的页面结构: Page structure

我想让主页和iframe在IE8模式下渲染,但只有主页在IE8模式下渲染(iframe中的内容在IE10模式下渲染)。在主页和 iframe 内容中,我都有:

tag <!doctype html> and metadata X-UA-Comapatible: IE=EmulateIE8

如果我单独运行 iframe 的内容,它会在 IE8 模式下呈现。

如何在 iframe 中强制 IE10 使用 IE8 模式?

最佳答案

“模拟”值告诉 IE 遵循默认行为;即,根据文档类型声明 (doctype) 使用它通常使用的模式。

由于您使用的是 HTML5 文档类型,这将导致 IE 选择边缘模式,即该版本的 IE 可用的最新和最好的模式。

要将事物限制为特定模式,请在您的内容属性值中指定,例如content="ie=8"

请注意,您可能需要为父 iframe 和子 iframe 执行此操作。 (在某些版本中有一组特定的解析规则,允许您混合使用标准模式,但这更令人困惑,因此最好始终保持一致。)

参见 Specifying legacy document modes了解更多信息。

希望这有助于...

-- 兰斯

关于html - 在 IE10 iframe 中强制 IE8 仿真,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26543865/

相关文章:

javascript - 如何克隆大量 HTML 同时更改属性值

jquery - Selenium 在 Internet Explorer 中的 wait_for_condition

windows - 如何推出用 VB6 编写的 ActiveX 控件的新版本

html - .ico 不显示在 IE 中?有什么办法可以在 IE 中显示 ico 文件?

javascript - 如何在iframe中显示来自div标签的所有超链接

html - float :left div with a paragraph/text on the right

javascript - facebook 和 twitter 插件位置

javascript - 是否可以在 iframe 上停止/暂停视频?

html - iOS 网络应用程序中的 Facebook/Google+/Twitter 共享功能

javascript - 为什么使用不同电脑时 "WebRTC Screen sharing"不流?