To contain floats all that is needed is an overflow (auto/hidden/scroll). It doesn’t matter which.
hidden is the preferred choice because in overflow:auto; IE will someetimes show scrollbars if it thinks the text (or content) is wider then it is. Then scrollbars appear and we don’t want that
So hidden is preferred now. The actual overflow:auto (what it’s suposed to do (show scrollbars once content meets the width/height set)) isn’t waht we are after. We are after the side effect-containing the floated elements, which both overflow:auto;/hidden; do
The point seems to be that once a container is supposed to actually do something special with “overflow” then it means the container must be able to “see” its children. So the rules change over to what static boxes with static children do.
I often have trouble with overflow: hidden and 100% height pages (even min-height). Mostly with in-page skip links. For IE6 you can just tell it specially “overflow: visible” to undo the “hidden”, but if other browsers find some problem with the height and the overflow, then another enclosing method might be better (but overflow is the easiest way to solve enclosing problems so I’d stick with it and just be aware of possibly problems so you can switch to another solution if needed).
If I understand correctly then you can’t do what you are trying to do. You cannot have multiple elements stretching down to 100% in css - only tables cells can do that (sometimes).
Apart from the height:100% in html and body you cannot use height:100% anywhere else and you can only use min-height:100% on the first wrapper on the page and nowhere else either.
In essence the first min-height:100% element creates the 100% height effect which it can achieve via the 100% height set on html and body. Further nested elements cannot achieve any height based on this min-height element because that will collapse to height:auto.
You cannot use height:100% again because that would mean the layout would never grow and you would be trapped forever within the initial viewport.
It’s a catch 22 situation and cannot be done like you have tried
Remove all the height:100% from your code apart from the ones that are used for html and body.
Use min-height:100% on the first wrapper only.
You have one shot at creating a 100% initial layout and it all has to be done on that first wrapper. If you want the white background to travel down the page to the bottom then you would need to add a white background to the image that creates the borders.
Ryan Fait’s sticky footer method - a method invented by Paul O’Brien over 7 years ago - is outdated. For the sake of cross-browser compatibility, this sticky footer version is much better supported.
As Kohoutek mentions breifly Ryan Faits sticky footer is broken badly in IE. He gave you the link to the most recent sticky footer and is very reliable and stable.
The problem with Ryan Faits is IE
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */
}
He is trying to trick IE there. The sticky footer should not have a bottom margin (a top negative margin instead) and the only height/min-height rule there should be the min-height:100%.
Then Ie6 should be fed the height:100% via the star html hack (* html #element{height:100%;})
What I never liked about Ryan’s sticky footer was the addition of an empty div called “push”. It seemed no better than clearing divs.
[ot]
As Kohoutek mentions breifly Ryan Faits sticky footer is broken badly in IE. She gave you the link to the most recent sticky footer and is very reliable and stable.
Fixed : )[/ot]
THe .push element is unnecessary and is attributed to the bad way his sticky footer is set up. Had he done it correctly there would be no need for that extra element
I just looked at this post again, wasn’t expecting a flurry of responses!
I’ll change the css over, thanks for this note, to be honest it worked for me in IE8, thats just reminded me that I need to get back into the habit of testing earlier versions.
I’ve really appreciated everyones help and comments with this