block formatting context
A self-contained layout region in which blocks are laid out one after another and whose margins do not collapse with anything outside it.
In more detail
Some elements create a new one automatically, such as flex and grid items. display: flow-root creates one on purpose, which contains floats and stops margins leaking out.
Related terms
- display: flow-root — A display value that makes an element a normal block which also starts a new block formatting context.
- margin collapsing — The CSS rule that when two vertical margins of blocks touch, they merge into one margin equal to the larger of the two instead of adding up.
- normal flow — The default way boxes are laid out when no flex or grid is used: blocks stack top to bottom and inline content flows left to right in lines.
Taught in
- Modern Box Model, Box Sizing, Display Types And Flow Layout — Frontend Architecture & Web Platform