HTML / CSS: Div 100% Page Height

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

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

+3
source share
2 answers

Use

body,html
{
   height:100%;   
}
+7
source

Each containing element must have a height set to 100% along with the element you want it to be 100%. This assumes that the target element (here the blue square div) is not located absolutely, and in this case you can simply set both its "upper" and "lower" values ​​to zero.

+1
source

All Articles