深入理解BFC

普通流

BFC

可以看作是一个独立的布局区域

触发条件

  1. <html>
  2. float: !none
  3. position: absolute | fixed
  4. display: inline-block | table ...
  5. overflow: !(visible | clip) && 是块级元素
  6. containe: layout | content | paint
  7. 多列容器 column-count | column-width

作用

  1. 避免margin塌陷 (包括水平和垂直)
  2. 清除浮动
  3. 避免被浮动元素覆盖

浮动流

绝对定位