I want to make body have 100% of the browser height. Can I do that using CSS?
I tried setting height: 100%
, but it doesn\'t work.
I want to set
If you have a background image then you will want to set this instead:
html{
height: 100%;
}
body {
min-height: 100%;
}
This ensures that your body tag is allowed to continue growing when the content is taller than the viewport and that the background image continues to repeat/scroll/whatever when you start scrolling down.
Remember if you have to support IE6 you will need to find a way to wedge in height:100%
for body, IE6 treats height
like min-height
anyway.