views:

137

answers:

2

I've got three columns inside of a div that is the full page width. The two on either side are 25% width and the one in the center is 50% width. This layout is working fine except in IE6 where at certain page widths it bumps the right column to the next line. Is there a fix for this? Maybe an alternate way to layout a page like this?

Edit: I'm using a cross browser inline-block hack that works great in FF, IE, S, Chrome. I'm pretty sure this quirk has to do with the way IE calculates widths on fluid content, and happens due to miscalculation (rounding maybe?). I've put up an example here. Try slowly adjusting the window width in IE6 (maybe later versions too) and watch as the green DIV gets bumped down at certain widths.

Thanks,
Brendan

A: 

It sounds like a piece of content in that column might have a defined width which is more than what the 25% of page width it is given. Can you provide CSS examples?

EDIT: IE6 does not support inline-block which could also be the issue.

EDIT 2: I looked at it on a 1680x1050 screen in IE6 in a virtual machine. When I drag the width slowly over time from about 800px to 1600px, it randomly moves the right column around. I suspect it's an issue with the hack that you're trying to use. Your code is so simple that I think you should consider researching an alternate hack instead. I've also never seen the *<property>: <value> hack. What's the * do, all compliant browsers?

Mark Ursino
Please see edit
Bloudermilk
Mark, I've substituted the inline-block hack for a float property and the problem persists.
Bloudermilk
+1  A: 

It's a rounding problem in IE6's box model. Generally, you can't have a combination equal 100%. Try making your values sum to 99% of total width, and it should work fine. This solution has always worked for me.

Jarrett Meyer
Went with setting the center column to 49.9%. I suppose it'll have to do. Thanks
Bloudermilk
It isn't just an IE6 problem: the 1px rounding problem is something that has affected every browser, and it's only with Firefox 3 and IE 8 that the problem appears to have been solved. See http://positioniseverything.net/round-error.html for more info, and the curious may want to check out the Mozilla bug report; it took seven years (from 2000 to 2007) to fix this one: https://bugzilla.mozilla.org/show_bug.cgi?id=63336
NickFitz