我的网站上有一个 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>
它不仅仅是尽可能多地延伸到页面底部并有一个滚动条。为什么要假设这个高度?
快照:
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/