I want to make body have 100% of the browser height. Can I do that using CSS?
I tried setting height: 100%
, but it doesn\'t work.
I want to set
I would use this
html, body{
background: #E73;
min-height: 100%;
min-height: 100vh;
overflow: auto; // <- this is needed when you resize the screen
}
The browser will use min-height: 100vh
and if somehow the browser is a little older the min-height: 100%
will be the fallback.
The overflow: auto
is necessary if you want the body and html to expand their height when you resize the screen (to a mobile size for example)