View Full Version : height of the browser

07-31-2011, 04:19 AM
Is there a way to make a div's height exactly the browser's height (without scrolling)?

I've tried height:100%; but that only makes it as big as the content.

07-31-2011, 06:40 AM
Are you making your container 100% or your actual div? if so it could be everything colliding.

07-31-2011, 09:06 AM
100% is based on the parent element

<div class="container">
<div class="rada"></div> <!-- if container is 400px, then rada height: 100% is 400px; -->

you have to set

body, html {
height: 100%;

and everything leading up to your div has to be 100% height (of the body) as well. ie: .container { height: 100%; }


I believe you can also use position: absolute;, as long as no elements leading up to the child are position: relative;

body, html {
height: 100%;

.rada {
position: absolute;
height: 100%;

<div class="container" style="height: 400px;"> <!-- Cannot be position: relative; -->
<div class="rada"></div>