开发者

margin collapsing

开发者 https://www.devze.com 2023-01-09 02:57 出处:网络
Do vertical margins between a floated box and any other box collapse? Do margins of absolutely and rel开发者_StackOverflowative boxes collapse?
  1. Do vertical margins between a floated box and any other box collapse?
  2. Do margins of absolutely and rel开发者_StackOverflowative boxes collapse?


  1. 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).

  2. 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.

0

精彩评论

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