Question

I'm having a problem with overflow and width in Google Chrome/Webkit. This is a follow-up question on this question, there you will find the CSS. I need to have visibility: hidden to fix the problem in the first question.

The problem is visible in the screenshots below.

Why does this attribute affect the width in Webkit? Can I solve this without nasty hacks? Or can I re-think my strategy for the right pane?

Main div with overflow: visible. The div is stretched to the right pane, as it should be.

no overflow

Main div with overflow: hidden. The right pane is now affecting the main div's width.

overflow

Was it helpful?

Solution

It's due to "formatting context" : http://www.communitymx.com/content/article.cfm?cid=6BC9D

"Floats don't overlap each other, and neither will a float overlap an element that establishes a new block formatting context."

If you use overflow: hidden to create a new block formatting context in the main div, you don't need the horizontal margins any more.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top