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

Taught in

References