FoobarMaximus
FoobarMaximus

Reputation: 73

HTML/CSS: Div 100% height of page

How do I get the div (the blue box) to fill out the whole page? I have the body tag set to height:100%, but this doesn't seem to matter.

See http://jsfiddle.net/rVyrX/1/

Upvotes: 3

Views: 3863

Answers (2)

Chris Kobar
Chris Kobar

Reputation: 11

Every containing element must have it's height set to 100% along with the element that you want sized to 100%. This assumes that the target element (here, the blue box div) is not positioned absolutely, in which case you can simply set both its "top" and "bottom" values to zero.

Upvotes: 1

Amit
Amit

Reputation: 22076

Use

body,html
{
   height:100%;   
}

Upvotes: 7

Related Questions