BFC triggers and rules

Triggering conditions:

Value is not none of 1.float

The value is not visible 2.overflow

3.display value table-cell, tabble-caption inline-block and one

4.position value is not a static or any of the releative

rule:

1. The floating element will be calculated height parent (parent triggered BFC)

2. Non-floating elements are not covered by the float position (non-floating elements triggered BFC)

3.margin not be delivered to the parent (the parent triggered BFC), the upper and lower margin of two adjacent elements overlap (one of the elements to increase a parent, then let his parent trigger BFC)

 

Clever usage:

Clear float;

Non-covered floats floating element, can be relied upon to solve trigger BFC

margin merger cases in which a parent element to trigger BFC, will not merge margin

Guess you like

Origin www.cnblogs.com/liuyuweb/p/11284826.html