...

View Full Version : height of the browser



reton
07-31-2011, 03: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.

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

Sammy12
07-31-2011, 08: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; -->
</div>


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%;
}




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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum