问题
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