使iframe高度自动延伸到浏览器窗口的底部?

时间:2016-05-12 17:12:26

标签: html

我正在创建一个网站(codersdomain.site88.net),我有一个iframe,需要扩展到浏览器窗口的底部。这是我的HTML:

<!DOCTYPE html>
<head>
<link rel="icon" 
      type="image/png" 
      href="./icon.png">
</head>
<title>Coder's Domain</title>
<body style="overflow-x:hidden; overflow-y:hidden; height:100%;"
 background="BG.jpg">
<div align="center">

<iframe tabindex="-1" style="height:590px; width: 596px; overflow-y:'scroll' overflow-x:'hidden' " src="index_data.html"frameborder=0 ></iframe>
</div>

</body>

有人可以告诉我如何让高度自动延伸到窗口的底部吗?

body { overflow-x:hidden; overflow-y:hidden; height:100%; }
iframe {height:590px; width: 596px; overflow-y:'scroll' overflow-x:'hidden'}
    <body
     background="BG.jpg">
    <div align="center">
    
    <iframe tabindex="-1" src="index_data.html" frameborder=0 ></iframe>
    </div>
    
    </body>

1 个答案:

答案 0 :(得分:3)

只需将高度更改为100%

 <iframe tabindex="-1" style="height:100%;
 width: 596px; overflow-y:'scroll' 
 overflow-x:'hidden' " src="index_data.html"frameborder=0>

</iframe>
</div>