CSS 2.1 spec: rationale for not collapsing margins of parent (when parent is float or has overflow other than visible)
问题 The CSS 2.1 specification, section 8.3.1 on collapsing margins states: Margins of elements that establish new block formatting contexts (such as floats and elements with 'overflow' other than 'visible') do not collapse with their in-flow children. It took me a while to realize that the block formatting context is the context that is established by the parent and applied to the children, so that to make any difference, the float or overflow properties have to be adjusted on the parent element