I have been reading all the 100% div height discussions and I can\'t find a simple solution. How can I make my div take up all of the vertical height of the screen?
You have to make the <body>
tag of the height 100% as well, otherwise it is vertically truncated to fit the content.
Also make sure to put the margin of <body>
to 0px, because otherwise it will become 100%_of_visible_area + margin, resulting in a vertical scroll bar.
Try to set height:100%
for your <body>
and <html>
, too.
If there is nothing except this div on your page, 100% height will be 0px without these settings.
html, body {padding: 0px; margin: 0px; height: 100%;}
http://jsfiddle.net/kEv8F/ - my version.
http://jsfiddle.net/kEv8F/ - your version.
Is that what you meant?