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 s开发者_运维问答tretched to the right pane, as it should be.
Main div with overflow: hidden
. The right pane is now affecting the main div's width.
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.
精彩评论