iframe博客作者的身高100%

时间:2018-07-05 18:30:34

标签: iframe blogger

如您所见,当“宽度100%”正常时,我的iframe高度调整不起作用。

Sample iframe post

我试图在模板和帖子中添加一些不同的代码,但是作为普通博客用户,我做不到。

感谢帮助!

1 个答案:

答案 0 :(得分:0)

<div style="max-width: 800px; max-height: 800px;">
<div style="left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.3%; overflow: hidden;">
<iframe src="YOURLINK"
             allowfullscreen
             style="position: absolute; top: 0px; left: 0px; height: 100%; width: 1px; min-width: 100%; *width: 100%;"
             frameborder="0"
             scrolling="no">
</iframe>
</div>
</div>

由于此代码,我解决了我的问题。它正在响应性地排列“高度”,您可以另外调整内容尺寸。