Why doesn't min-height not work on my page?
Specify height: 100%
on the html
, body
and #body2
elements (line 1358).
html, body, #body2
{
height: 100%;
min-height: 100%;
}
Not tested in IE 6, works in 7 though.
Using vh instead of % worked for me without having to use any extra tricks.
This is what I have:
html, body, .wrapper {
min-height: 100vh;
}
Where .wrapper is the class you apply to your container/wrapper or main body of content that you wish to stretch the full length of the screen height.
This will work as you would expect it to when the content within the wrapper is less or more than the screen height allows.
This should work in most browsers.
You have your min-height set to 100% which will only be as tall as any elements that fill the space. Express you min-height in terms of pixels. Also, note that IE6- requires it's own set of rules. See http://davidwalsh.name/cross-browser-css-min-height for more details.