开发者

WebKit and overflow: hidden affecting width

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.

WebKit and overflow: hidden affecting width

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

WebKit and overflow: hidden affecting 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜