margin collapsing
- Do vertical margins between a floated box and any other box collapse?
- Do margins of absolutely and rel开发者_StackOverflowative boxes collapse?
Float margins don't collapse. According to the spec:
Vertical margins between a floated box and any other box do not collapse (not even between a float and its in-flow children).
Absolute positioned margins don't collapse. According to the same spec:
Margins of absolutely positioned boxes do not collapse (not even with their in-flow children).
No, margin collapses only between two adjacent block
elements when they have margin towards each-other.
精彩评论