Bugzilla – Bug 16113
How horizontal margins of a BFC block adjacent to a floated block should be rendered
Last modified: 2012-12-04 00:51:50 UTC
Test and demo pages
[CSS21] Floats, overflow: hidden, BFCs and margins
Excerpts of current spec
In a block formatting context, each box's left outer edge touches the left edge of the containing block (for right-to-left formatting, right edges touch). This is true even in the presence of floats (although a box's line boxes may shrink due to the floats), unless the box establishes a new block formatting context (in which case the box itself may become narrower due to the floats).
The border box of a table, a block-level replaced element, or an element in the normal flow that establishes a new block formatting context (such as an element with 'overflow' other than 'visible') must not overlap the margin box of any floats in the same block formatting context as the element itself. If necessary, implementations should clear the said element by placing it below any preceding floats, but may place it adjacent to such floats if there is sufficient space.
The CSS2.1 spec should indicate how horizontal margins of the orange BFC should be rendered, especially
- the left margin of the non-floated BFC in tests #1, #2 and #4 of marges-contexte-formatage.html
- the right margin of the non-floated BFC in tests #4 and #5 of marges-contexte-formatage.html
- the right margin of the non-floated BFC in all 8 sub-tests of Floats-And-BFCs-With-Margins-AG.html
Credits go to Florent Verschelde for his original article on this issue.
I propose closing moving this bug to CSS3-box, as explained in http://lists.w3.org/Archives/Public/www-style/2012May/0708.html