CSS Flow Layout: Block, Inline, and Normal Flow
Understand how block and inline boxes participate in normal flow, how available space and block formatting contexts shape that flow, and where Flow Layout stops and other CSS modules take ownership.
Basic
Normal flow is the default layout system
When an element is not taken out of flow and its formatting context is not replaced by another layout system, CSS lays its boxes out in
normal flow. Block-level boxes participate one after another in the block direction, while inline content is arranged within line boxes in the inline direction. Normal flow is not a single visual style; it is the default set of layout rules that keeps neighboring content participating in the same layout.
Output
Ready to run.
Quick check
What does normal flow primarily describe?
Block boxes stack in the block direction
A block box normally occupies a block-level position in its containing block. Successive block boxes are laid out in the block direction, so later siblings normally appear after earlier siblings rather than sharing the same line. The exact dimensions and spacing of those boxes are separate responsibilities: the Box Model owns padding, borders, and margins, while Sizing will own the algorithms that determine dimensions.
Output
Ready to run.
Quick check
Why do these ordinary block siblings appear one after another?
Inline boxes share lines of inline content
Inline-level boxes participate in the inline formatting context rather than creating a new block-level position for each sibling. Text and inline-level descendants are arranged into
line boxes. When the available inline space is exhausted, content can continue on another line. This lesson introduces that arrangement; detailed typography, line breaking, justification, and text shaping belong to the Text Layout owner.
Output
Ready to run.
Quick check
What is the key difference between ordinary block and inline participation?
The containing block gives normal flow its space
Normal-flow layout happens inside a containing block. The containing block supplies the available space against which the layout rules resolve dimensions and arrange descendants. Do not confuse this with the containing-block rules for absolutely positioned elements: those belong to Positioned Layout. Here the important idea is simply that normal-flow descendants are laid out within an ancestor-established formatting context and available space.
Output
Ready to run.
Quick check
In normal flow, what role does the containing block provide?
Block formatting contexts isolate block layout
A
block formatting context (BFC) is an independent block-layout environment. Its participating block boxes are laid out with respect to that formatting context rather than directly sharing the surrounding block formatting context. This matters for interactions such as containing floats and preventing certain margin-collapsing relationships. The mechanism that creates a BFC is owned by the relevant layout/display feature; this lesson explains what the independent block context does, not every way one can be created.
Output
Ready to run.
Quick check
What is the useful mental model for a block formatting context?
Normal flow responds to available inline space
Inline content is constrained by the available inline space of its formatting context. As that space changes, inline content can form different line boxes without requiring a new layout model. This is one reason normal flow is naturally adaptable: the content participates in the space supplied by its containing context rather than being assigned a fixed visual row.
Output
Ready to run.
Quick check
What can change when the available inline space becomes narrower?
Margins affect spacing, but their collapse is a Box Model rule
Normal flow determines where in-flow boxes participate, but it does not own every spacing rule. In particular, margin collapsing is part of the Box Model lesson and is intentionally not re-taught here. Keep the boundary clear: Flow explains the arrangement of boxes; Box Model explains the spacing layers and margin-collapse behavior that can affect the resulting gaps.
|
|
Quick check
Where should margin collapsing be learned?
Floats and positioning change flow participation
Not every CSS layout feature leaves an element in ordinary normal flow. Floats alter how surrounding content flows around a box, while absolute and fixed positioning remove boxes from normal-flow participation. The existing Positioning lesson owns those mechanisms, so this lesson uses them only as boundaries: normal flow is the baseline from which those other models differ.
Output
Ready to run.
Quick check
Which lesson owns absolute positioning and its removal from normal flow?
Flow does not mean every element uses the same formatting context
Normal flow is a family of in-flow behavior, not a command that forces every descendant into one identical algorithm. A block container can contain inline content; a descendant can establish another formatting context; and Flexbox or Grid can replace the child layout algorithm inside a container. Display chooses many of those formatting-context roles, while the dedicated layout module owns the algorithm once selected.
Output
Ready to run.
Quick check
If a descendant is a flex container, which rules arrange its flex items?
Block and inline are roles, not HTML semantics
CSS block-level and inline-level roles are presentation concepts. They do not change the meaning of the HTML element. A paragraph can participate as a block-level box without CSS defining what a paragraph means, and an element can be styled differently without changing its HTML semantics. HTML remains the owner of document meaning; CSS controls presentation and layout.
Quick check
Does changing an element from block-level to inline-level change its HTML semantics?
A small normal-flow debugging method
When normal-flow layout surprises you, inspect the boxes in this order: identify whether each box is in flow; identify its outer and inner display roles; determine whether the parent establishes the expected formatting context; identify the available inline and block space; then inspect Box Model spacing and Sizing constraints. This sequence prevents a spacing symptom from being mistaken for a box-generation or layout-model problem.
Output
Ready to run.
Quick check
What should you identify before changing margins to fix a mysterious layout?
Specification boundary and maturity
The primary normative authority for this lesson is the W3C CSS Display and layout specifications. CSS Display Level 3 is a Candidate Recommendation Draft, while CSS Display Level 4 is a Working Draft. The detailed behavior of block and inline layout is distributed across the relevant CSS layout modules, so this lesson presents the stable normal-flow model without pretending that every future draft feature is equally mature.
Normative starting points: CSS Display Module Level 3, CSS Display Module Level 4, and the established visual formatting model in CSS 2.1. Inline formatting is being kept aligned with the W3C CSS Inline Layout work as that model develops.
Quick review
You should now be able to explain what normal flow is, distinguish block and inline participation, recognize the role of line boxes and block formatting contexts, and diagnose whether a surprise belongs to Flow Layout or to another CSS owner.
Thanks for your feedback.
Mark this learning resource complete to track your learning progress.