开发者

fix iframe position

开发者 https://www.devze.com 2023-03-22 19:46 出处:网络
I have a form on the top of a page with a height of 20-30px and a width of 100%. Below there\'s an iframe with a height of 100% and a width of 100%. But this brings a scroll, because the height of the

I have a form on the top of a page with a height of 20-30px and a width of 100%. Below there's an iframe with a height of 100% and a width of 100%. But this brings a scroll, because the height of the page is out of the bounds.

How do I make both fit 100% without having a scroll?

P.S I know chang开发者_如何学运维ing the height to 83% of the iframe will make it work, but only for chrome, for IE it is different story...


Try setting the <iframe> to have position:absolute in position to the form:

 form{
      width:100%;height:30px;
 }
 iframe{
      width:100%;position:absolute;top:30px;bottom:0px;
 }
0

精彩评论

暂无评论...
验证码 换一张
取 消