我如何使iframe填充页面的其余部分? [英] How do I make an iframe fill the rest of the page?

查看:150
本文介绍了我如何使iframe填充页面的其余部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在用HTML编写一个网站,我一直想知道如何让iframe填充页面的其余部分,而不会与导航栏重叠,也不会让整个页面滚动。

解决方案

如果你不给我们一个代码作为例子,它将很难给你一个确切的答案。

我的理解是您想要一个标签来填充页面的其余部分。我假设你在谈论身高。



您可以使用css来获得:

  html,body,iframe {height:100%} 

通过iframe进行导航,您需要减少iframe的高度减去导航高度。为此,您可以使用calc: b
$ b
$ b

  iframe {height:calc(100% -  80px)} 

示例:小提琴


I've been coding a website in HTML, and I've been wanting to know how to make an iframe fill the rest of my page without overlapping the navigation bar, and without making the whole page scroll.

解决方案

If you don't give us a code as example it will be very difficult to give you a precise answer.

What I understood is that you want a tag to fill the rest of the page. I assume you're talking about the height.

You can use css to get that:

html, body, iframe {height: 100%} 

If you have a navigation over the iframe, you'll need to reduce iframe's height minus navigation height

For that you can use a calc:

iframe {height: calc(100% - 80px)} 

Example here: fiddle

这篇关于我如何使iframe填充页面的其余部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆