BFC definition
BFC (block formatting context) literal translation is "blocks-level formatting up and down?". It's a unique rendering area, with only the Block-level box parameter
And, it specifies how the internal block-level box is laid out and irrelevant to the outside of the area.
BFC Layout Rules:
The inside box will be placed vertically, in a vertical direction, and then in a single place.
The distance from box vertical is determined by margin. A margin of two adjacent boxes belonging to the same BFC
The left side of each element's margin box is in contact with the left side of the containing block border box (or vice versa for formatting from left to right).
This is true even if there is a float.
The BFC area does not overlap with the float box.
BFC is?? An isolated container, a container? element does not affect the outer element. The reverse is true.
Floating elements also participate in calculations when calculating BFC degrees
Elements that can trigger BFC
root element
The Float property is not none
Position for absolute or fixed
Display for Inline-block, Table-cell, Table-caption, Flex, Inline-flex
The overflow is not visible
Role
1. Clear internal float
2. Prevent vertical margin overlap
3. Adaptive two-column layout
BFC Layout Rules