Reputation: 912
I would like to make the html, body and wrapper elements all have a minimum height of 100% in order to cover the whole viewing window, but I have found that I can only make html obey this declaration.
html, body, #wrapper {
min-height:100%;
}
html {
border: 2px red solid;
}
body{
border: 2px blue solid;
}
#wrapper {
border: 2px pink dotted;
}
Create a simple html document with only a #wrapper div which can either have content in it or not. If a min-height of pixels is used, the elements obey it, but when I use percentages only html will work. Why is this?
Upvotes: 3
Views: 987
Reputation: 3515
Use height
instead of min-height
.
body,html{
height: 100%;
}
#wrapper {
height: 100%;
}
Upvotes: 1
Reputation: 2980
This will definitely help you...
http://www.cssstickyfooter.com/using-sticky-footer-code.html
Upvotes: 0