Css 具有自动高度且无垂直滚动的iframe
我需要一个iframe与自动高度(没有垂直滚动,它应该采取所有的空间,它需要和滚动主页只是罚款) 我拥有的当前代码不会出现这种情况:Css 具有自动高度且无垂直滚动的iframe,css,twitter-bootstrap-3,Css,Twitter Bootstrap 3,我需要一个iframe与自动高度(没有垂直滚动,它应该采取所有的空间,它需要和滚动主页只是罚款) 我拥有的当前代码不会出现这种情况: <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap IFrame Example</title> <meta charset="utf-8"> <meta name="viewport" content="widt
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap IFrame Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<div class="row">
<div class="col-xs-6">Check the iframe at the right</div>
<div class="col-xs-6">
<div style="width:100%; height:auto;">
<iframe src="http://www.wsj.com/" style="width:100%; height:auto;overflow-y:hidden"></iframe>
</div>
</div>
</div>
</body>
</html>
引导IFrame示例
检查右侧的iframe
不幸的是,这在每个
HTML4.01和HTML5之间的差异
在HTML4.01中,高度可以用像素或包含元素的百分比来定义。在HTML5中,值必须以像素为单位
你能做的唯一一个黑客,这是一个巨大的红色警示标志和闪烁的灯光,是下面的CSS代码:
html, body, div, iframe {
height: 100%;
}
/* OR */
*{
height: 100%;
}
这段代码使页面中的所有内容都达到100%的高度,从而也可以调整iframe。但正如我所提到的,在这一过程中,你们会遇到一些重大问题。我这样做的唯一方法是设计一个仅用于打印的报告屏幕(即优惠券兑换屏幕,或仅用于移动应用程序的小型广告)
又来了。我强烈劝阻任何人在普通web应用程序中尝试此功能
请参见“显示全高”我的意图的可能重复之处是在web应用程序中使用它。出于上述原因,我强烈建议使用它。正如我所说的,你唯一能做的就是我的建议,但是要准备好面对更多的问题,特别是因为你正在使用Bootstrap。设计用于为您提供更稳定的UI体系结构的框架