【问题标题】:Iframe Height in the Google ChromeGoogle Chrome 中的 iframe 高度
【发布时间】:2011-10-13 09:01:04
【问题描述】:

我的 .aspx 页面中有一个 iFrame,它重定向到我的解决方案之外的外部页面。

我遇到的问题是在 Google Chrome 中,iFrame 的高度似乎改变了 .aspx 页面的高度。这仅发生在 Google Chrome 上。

<iframe runat="server" id="ifTest" name="ifTest" frameborder="0" height="790px"
width="960px" class="iframeTest" style="position:inherit;"></iframe>

CSS 类 iframeTest 在我的解决方案之外,我的意思是,我的 iframe 显示了一个在我的解决方案之外的页面。

例如,这是代码隐藏中的 iframe 示例,用于显示我的解决方案之外的页面。

this.ifTest.Attributes["src"] = "the_page_link_that_i_want";          

我的问题只是谷歌浏览器中的 iframe 高度,因为谷歌浏览器中的页面在页脚后显示了一个很大的空白。

【问题讨论】:

    标签: javascript jquery css google-chrome iframe


    【解决方案1】:

    删除 iframe 中 widthheight 属性中的 px

    例如

    <iframe runat="server" id="ifTest" name="ifTest" frameborder="0" height="790"
    width="960" class="iframeTest" style="position:inherit;"></iframe>
    

    与/或

    添加一个额外的样式:

    iframe{ width:960px; height:790px;}
    

    *如果这有帮助,请告诉我,否则我可以进行更多调查...是否有一些链接可以查看?还是 JSfiddle 链接?

    【讨论】:

    • 好吧,我找到了解决方案。我只是将 iframe 放在另一个 div 中。看起来很奇怪,因为没有这个 div,在所有浏览器中都可以正常工作。 DIV 样式溢出隐藏
    猜你喜欢
    • 2016-11-29
    • 2015-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多