【发布时间】:2015-09-15 20:01:22
【问题描述】:
this is how it should look 但是当我粘贴相同的代码时:
<!-- dummy div -->
<div style="height:100px;">
</div>
<!-- outer div to contain inner div (that has a margin) -->
<div style="height:80vh;">
<!-- inner most div now has its boundary defined by the outer div, so adding a border wont extend its width beyond the width of the browser window -->
<div style="height:80vh; padding: 20px;">
<!-- iframe set to fill 100% of its containing div -->
<iframe src="http://insitu-app.com/insitu-tgrg-simplified.html" style="top:0; left:0; height: 100%; width: 100%; margin-left: auto; margin-right: auto; border: none" frameborder="0" allowfullscreen></iframe>
</div>
</div>
进入 wordpress 代码编辑器并发布,this is what I get。我希望 div 标签及其内容占据视口垂直高度的 80%。如果这种方法在 wordpress 上不可行并且它们是替代方法,请告诉我?非常感谢
【问题讨论】:
-
在另一个
80vhdiv 中添加80vhdiv 和padding不是一个好主意。将内部 div 的高度更改为100%并添加box-sizing: border-box;或从父 div 中删除高度。 -
感谢内部 div 现在是:
<div style="height:100%; box-sizing: border-box; padding: 20px;">如果不行请告诉我
标签: html css wordpress responsive-design