此页面 ( http://purcraft.com/madeinla/) 有问题,我正在尝试使用 iframe 元素显示此页面的内容:( http://purcraft.com/madeinla/home2_height.html)。
宽度不错,但高度呢?似乎更像是 100px 而不是我想要的 100%。为什么是这样?这是我的代码。这非常简单。
<iframe style="overflow:hidden;height:100%;width:100%" height="100%" width="100%" src="http://purcraft.com/madeinla/home2_height.html"></iframe>
最佳答案
像这样尝试:
给 position: absolute;和 border:none;
到您的 IFRAME
以及 height:100%
以获得预期的结果。
HTML:
<iframe width="100%" height="100%" src="http://purcraft.com/madeinla/home2_height.html" style="position: absolute; height: 100%; border: none"></iframe>
关于CSS:iframe 不显示 100% 高度...更像是 100px 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29641823/