将身高设置为100% [英] Setting body height to 100%

查看:102
本文介绍了将身高设置为100%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将所有我的网页(主页除外)放在 http://www.zorglegal.nl 到相同高度(浏览器高度为100%),因此右侧的棕色栏从上到下全屏显示。我怎样才能最好地实现这一点?

I need to have the body of all my webpages (except homepage) located on http://www.zorglegal.nl to the same height (100% browser height), so the brown bar on the right is stretched full screen from top to bottom. How can I best achieve this?

html{
    height: 100%;
}

body{
    min-height: 100%;
}

不起作用。我也尝试为内容元素设置一个类,并尝试将其设置为100%高度,但这也不起作用。我怎么做到这一点?

doesn't work. I also tried to set a class for the content element and tried to set it to 100% height but that doesn't work either. How can i do this?

棕色条是一个PNG图像,并被设置为全宽度容器的背景图像。所以如果这个容器是100%高的话,它应该可以工作。但是怎么做?

The brown bar is a png image and is set as a background image for a fullwidth container. So if that container is 100% high, it should work. But how?

推荐答案

您可以使用视口高度。

You can use viewport height.

height: 100vh

这意味着div或者其他值一样高作为浏览器窗口。

This means that the div or whatever is as high as the browser window.

这篇关于将身高设置为100%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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