您的位置:首页 > 其它

iframe设置height无效

2016-02-24 17:59 204 查看
iframe设置height为100%无效,实际是因为父空间高度没有设置的问题。

代码如下

<body>
<iframe id="content" src="main.do" name="content" frameborder="0" scrolling="no" height="100%" width="100%"></iframe>
</body>

追加css,设置html跟body高度为100%,即可全屏显示iframe

html,body
{
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
height: 100%;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: