【问题标题】:iFrame Scaling Issues in Internet ExplorerInternet Explorer 中的 iFrame 缩放问题
【发布时间】:2012-08-14 22:18:23
【问题描述】:

我已经使用here 描述的方法在我的一个页面上设置了 iframe。我只是想要一个我正在尝试 iframe 的页面,所以我使用了各种浏览器的缩放/缩放功能。

为了加载某个部分,我将 iframe 包裹在一个 div 中,调整大小并缩放它。然后我将 iframe 放入该 div 并使用 top: -300px;

定位它

这在 Firefox 和 Chrome 中看起来很棒,但在 IE8 中根本无法正常工作(大吃一惊)。基本上,看起来其他东西正在干扰 IE8,并且浏览器不会从与其他浏览器相同的起点计算 top: -300px。因此,您最终在 IE8 中看到的结果与在其他浏览器中看到的结果不同。

好的,这是我正在使用的代码。我最终修改了上面前面提到的主题的代码,为了让 IE8 正确缩放 iframe 内容(而不是整个 iframe 本身),我必须缩放/缩放包装 div 而不是 iframe id 他们建议.

#themeframe {
    overflow: hidden;
    position: relative;
    width:800px;
    height:850px;
    -ms-zoom: 0.75;
}


#frame {
    position: absolute;
    overflow-x: hidden;
    top: -300px;
    -moz-transform: scale(0.75);
    -moz-transform-origin: 0 0;
    -o-transform: scale(0.75);
    -o-transform-origin: 0 0;
    -webkit-transform: scale(0.75);
    -webkit-transform-origin: 0 0; 

我做错了什么?或者,更确切地说,IE8 看到我不是什么奇怪的 CSS 字符?

【问题讨论】:

    标签: css internet-explorer iframe internet-explorer-8 scale


    【解决方案1】:

    -ms-zoom 可能是 IE8 不理解的东西。固定规则:zoom: 75%;。注意单位。

    【讨论】:

    • 不,这不起作用。它不能解决问题,这是肯定的,如果你没有-ms-zoom 而只是输入zoom,那么Chrome 会同时解释zoom-webkit,它会在Chrome 中破坏它。不过谢谢!
    猜你喜欢
    • 2011-01-02
    • 1970-01-01
    • 2015-06-15
    • 1970-01-01
    • 2014-08-24
    • 2011-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多