IFRAME 将高度设置为 100%
IFRAME Set Height to 100%
我正在尝试将 iframe 的高度设置为 100%。
但出于某种原因,我不能那样做。
我想删除 scroll so to iframe 每次显示高度 100%。
这是我的代码:
<div style="margin:0px;padding:0px;overflow:hidden">
<iframe src="https://example.com/" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%"></iframe>
</div>
试试这个。我目前无法对其进行测试,但您可以尝试。 **滚动可能是没有或 none 我不记得了。
<style type="text/css">
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
#content{
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0px;
}
</style>
<div id="content">
<iframe src="example.com" frameborder="0" scrolling="none" height="100%" width="100%" style="overflow:hidden></iframe>
</div>
试试这个。它对我有用:
<html>
<body style="position:relative;">
<div style="position:fixed; left:0; right:0; top:0; bottom:0;margin:0px;padding:0px;overflow:hidden">
<iframe src="https://example.com/" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%">
</iframe>
</div>
</body>
</html>
我正在尝试将 iframe 的高度设置为 100%。 但出于某种原因,我不能那样做。 我想删除 scroll so to iframe 每次显示高度 100%。
这是我的代码:
<div style="margin:0px;padding:0px;overflow:hidden">
<iframe src="https://example.com/" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%"></iframe>
</div>
试试这个。我目前无法对其进行测试,但您可以尝试。 **滚动可能是没有或 none 我不记得了。
<style type="text/css">
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
#content{
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0px;
}
</style>
<div id="content">
<iframe src="example.com" frameborder="0" scrolling="none" height="100%" width="100%" style="overflow:hidden></iframe>
</div>
试试这个。它对我有用:
<html>
<body style="position:relative;">
<div style="position:fixed; left:0; right:0; top:0; bottom:0;margin:0px;padding:0px;overflow:hidden">
<iframe src="https://example.com/" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%">
</iframe>
</div>
</body>
</html>