我正在使用 boostrap 3,我正在尝试在页面上嵌入演示文稿。它不是页面上的唯一元素。在这上面和下面还有许多其他行:
<div class="row">
<div id="iframecontainter" class="col-lg-6 col-md-6 col-sm-offset-1 col-md-offset-1">
<iframe src="http://docs.google.com/gview?url=http://example.com/presenation.ppt&embedded=true" frameborder="0"></iframe>
</div> <!-- #iframecontainter -->
</div> <!-- .row -->
&CSS:
iframe{
width:100%
}
以上代码按照我的意愿处理了宽度。但这是导致问题的高度。有没有办法设置高度:可用屏幕尺寸的百分比?否则解决方案是什么?
最佳答案
试试这个 -
html, body{ height: 100%; }
.row, #iframecontainter{height: 100%; }
iframe{
height:80%; border: 1px solid red;
}
关于css - 将 iframe 的高度设置为屏幕大小的 x%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22059328/