css - 似乎无法在 IE8 中正确显示 iframe?

标签 css mobile iframe internet-explorer-8 media-queries

我在这里有一个网站:Campus Tour我也试图在 iframe 中显示。此处的目标是能够准确地看到学生在移动设备上查看导览时所看到的内容。

这是 iPhone 视口(viewport):iPhone Viewport

它在 Chrome 中可以正常显示,但我无法在 IE8 中显示它。在 IE8 中查看时,iframe 以完整站点模式显示站点,并且不遵循移动 CSS。

这是我的 iframe 代码:

<div align="center" style="position: fixed; margin-top: 2%; margin-left: 12%; border: 5px solid #f60; width: auto; height: auto;">

                <h2 style="font-weight:bold; background-color: #f60; color: #fff;">iPhone 5 Display</h2>
                    <iframe style="width:568px; height: 320px; " src="http://webfro.gs/south/tour" frameborder="0"></iframe>
            </div>

我用谷歌搜索并阅读了有关 Quirks 模式等的信息,但不太确定如何应用它。我也不确定这是否是正确的解决方案。

为了在这里提供帮助,您还需要什么信息?

最佳答案

您的问题是 IE8 不支持 CSS 媒体查询,您使用它根据视口(viewport)的大小更改布局。

如果你需要为此支持 IE8,最好的解决方案是使用类似 Respond.js 的 polyfill 脚本,它将对媒体查询语法的支持反向移植到 IE8 中。

关于css - 似乎无法在 IE8 中正确显示 iframe?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17492818/

相关文章:

javascript - Iframe 跨域通信 - 调整大小事件 - 跨浏览器?

html - 后台没有设置

asp.net-mvc - 将元素放在一行中

ios - 同一站点仅通过蜂窝网络而不是通过 WiFi 生成 "too many redirects"

javascript - 未捕获的 SecurityError 端口问题 : Iframe resize

javascript - iframe 中的 GMap 偏离中心

html - 如果没有此 CSS 修复,为什么我的框边框不能围绕其中的 float 框? (修复是如何工作的?)

css - Max Bottom 一个 Popup Div

javascript - 单击 for zom 使移动图像全屏显示

iphone - 在手机上使用 GWT