CSS: iframe not displaying 100% height…more like 100px height

依然范特西╮ 提交于 2019-12-12 03:09:42

问题


Having an issue with this page (http://purcraft.com/madeinla/) which I'm trying to use an iframe element to display the contents of this page: (http://purcraft.com/madeinla/home2_height.html).

The width is good but the height? Seems to be more like 100px rather than the 100% I want. Why is this? Here's my code. It's pretty straightforward.

<iframe style="overflow:hidden;height:100%;width:100%" height="100%" width="100%" src="http://purcraft.com/madeinla/home2_height.html"></iframe>

回答1:


Try like this:

Give position: absolute; and border:none; to your IFRAME along with height:100% to get expected result.

HTML:

<iframe width="100%" height="100%" src="http://purcraft.com/madeinla/home2_height.html" style="position: absolute; height: 100%; border: none"></iframe>


来源:https://stackoverflow.com/questions/29641823/css-iframe-not-displaying-100-height-more-like-100px-height

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!