CSS学习之--BFC

BFC Block formatting context

概念:块级格式化上下文

满足下列条件之一就可触发BFC:

  1.根元素,即HTML元素 
  2.float的值为none 
  3.overflow的值不为visible 
  4.display的值为inline-block、table-cell、table-caption 
  5.position的值为absolute或fixed

功能:

1.阻止垂直外边距(margin-top、margin-bottom)折叠

2.BFC不与float重叠

2.清除内部浮动

posted on 2018-08-07 17:47  wujinpeter  阅读(77)  评论(0)    收藏  举报

导航