I am so excited. I've been plagued for a year by an Internet Explorer bug called the "float drop" bug (detailed nicely here). Basically, if IE tries to put an element next to a floated element, and the non-floated element is too wide for the container block, it drops the non-floated element down to AFTER the floated element.
We have a site with a three-column layout, and many different users entering content into the site. This bug has cropped up from time to time, usually when someone has input an image that's too large for the browser window or a table that's a bit too wide. It has the effect of looking like your content has simply disappeared, because it pushes it down after the left-hand menu. And I've hated having to tell people to alter their content just because Microsoft screwed up, but damn, I could not find the answer anywhere. A few workarounds, but nothing that applied to my situation.
Today I finally got mad enough to dig down and hack out a proper solution. And I found one:
* html #middle {
overflow-x: auto; overflow-y: hidden;
width: expression(document.body.offsetWidth - 400);
}
What this does:
I'm very happy with the final effect - the other browsers continue to behave nicely as they already were, and IE shows a discreet little scrollbar at the bottom of the page if the content is too wide. It lets the user view the site in a much narrower window without going wonky. And if the content editor wants to fix the width so the scrollbar doesn't appear, then that's fine too.
Tested in IE5.5 and IE6.0 PC. I hope this helps somebody else out too.
Kirsten Starcher lives in Vancouver, BC, spending half her time as a musician, playing bass in ARCTIC as well as solo, and the other half as a web designer/developer.
You can contact her at "kirsten at crowstoburnaby dot com" (turn it into a proper email address, of course!).