CSS:iframe不显示100%高度...更像100px高度

时间:2015-04-15 04:51:16

标签: css iframe height width overflow

对于此页面(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>

1 个答案:

答案 0 :(得分:1)

试试这样:

position: absolute; and 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>