
Originally Posted by
gusblake
[...] I have a container div (not floated, 100% height) [...]
Inside the column div on the left hand side i have a load of lorem ipsum text that is longer than my browser window, and in FF, the text goes straight off the end of the container div while the container div stays at exactly 100% height.
[...]
I heard of this fix where you put a div with clear:both straight after the two column divs, but this didnt work. [...]
Of course not!
You instructed the container to be of a specific height, so it's not about to change. IE's behaviour in this regard is broken (but will be taken advantage of in a moment as a hack).
What you should do is use the min-height property. This will allow the container to expand if necessary, but stay at 100% height otherwise. Unfortunately, not all browsers will support this. We can use IE's broken height behaviour as a workaround, but others may refuse point-blank.
Code:
#container {
min-height: 100%;
}
/* IE-specific hack */
* html #container {
height: 100%;
}
The '* html' start to the second selector is important as only IE recognises it (another bug
).
Hope that helps,
Mike
Bookmarks