css - 为什么 iframe 在 100% 高度时会超出页面末尾?

标签 css iframe html

我的网站上有一个 iframe,位于一个 div 中。我已将两者的高度都设置为 100% 我还使用了蓝图框架,因此 span-12 last 用于该类。我的问题是为什么网站上还有滚动条?

代码:

<div id="friend_pane" style="background-color: #FF0000;height: 100%;" class="span-12 last">
<iframe id="friendpane_area" style="width: 515px; height: 100%" src="http://friendsconnect.org/friendpane/shell.php" frameborder="0" allowTransparency="true"></iframe>
</div>

它不仅仅是尽可能多地延伸到页面底部并有一个滚动条。为什么要假设这个高度?

快照:

enter image description here

DIV 中的 iFrame 以红色标记。

最佳答案

有几件事你可以尝试,确保 html { height: 100% } 首先,然后

iframe { overflow:hidden; }

<iframe id="friendpane_area" style="width: 515px; height: 100%; overflow: hidden" scrolling="no" src="http://friendsconnect.org/friendpane/shell.php" frameborder="0" allowTransparency="true"></iframe>

关于css - 为什么 iframe 在 100% 高度时会超出页面末尾?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6300590/

相关文章:

html - Box Shadow 在输入焦点上工作不正确

javascript - jQuery Mobile - 无法使用常见的 jquery 方法隐藏按钮

css - 将 "Remember Me"和复选框对齐在同一行(Devise 的 CSS 问题)

javascript - 在 iframe 上抓取类(class)

javascript - 使用javascript jquery将html附加到具有指定类的按钮最接近的div

html - CSS 导航栏悬停问题

javascript - 如何使用 jquery 访问 iFrame 父页面?

html - IFRAME 中的嵌入式 Google 文档有时无法加载

javascript - Bootstrap Modal 在页面加载时触发,每个用户一次

弹出窗口中的 Javascript alert()