【问题标题】:Adjust Iframe height for IE11 with Document modes使用文档模式调整 IE11 的 iframe 高度
【发布时间】:2015-12-10 23:02:27
【问题描述】:

我正在使用 IE11,边缘文档模式,Windows 以不同的方式呈现 iframe 高度。 我以前用过这个。

<iframe name="stack" src="http://stackoverflow.com/" width='100%' height='100%' frameborder="0" id="iframe">...</iframe>

IE 将 iframe 缩小到只有几行高,宽度属性正常工作,但高度不正常。所以我给它添加了样式属性,现在高度也可以正常工作了。

<iframe name="stack" src="http://stackoverflow.com/" style='height: 100%; width: 100%;' frameborder="0" id="iframe">...</iframe>

但在调试模式下,当我切换到不同的文档模式时,iframe 高度又会变高。有没有我们可以使用的 javascript 来根据所有文档模式的窗口高度呈现框架高度?

【问题讨论】:

    标签: javascript internet-explorer iframe internet-explorer-11 microsoft-edge


    【解决方案1】:

    这取决于上下文。我猜你没有把身高拉伸到100%。

    html, body { 
        padding: 0;
        margin: 0;
        height: 100%;
    }
    

    【讨论】:

      猜你喜欢
      • 2013-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-12
      • 2016-02-28
      • 1970-01-01
      • 2012-08-06
      • 1970-01-01
      相关资源
      最近更新 更多