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
Only with 1 line of CSS… You can get this done.
body{ height: 100vh; }
A quick update
html, body{
min-height:100%;
overflow:auto;
}
A better solution with today's CSS
html, body{
min-height: 100vh;
overflow: auto;
}
@media all {
* {
margin: 0;
padding: 0;
}
html, body {
width: 100%;
height: 100%;
} }