Normal Flow, Display, and Positioning
Use normal document flow first, then choose display and positioning intentionally.
Normal flow gives block and inline content a resilient reading order. Display changes an element's formatting context. Positioned layout is useful for local overlays, but it should not replace the document structure or primary page layout.
See the core pattern
Read this rule set from the outside in. Identify the inputs, the decision or transformation, and the result before changing it.
.profile { display: flow-root; position: relative; }
.profile__badge {
position: absolute;
inset-block-start: .75rem;
inset-inline-end: .75rem;
}
.profile__body {
display: grid;
gap: .75rem;
}Working rules
- Confirm the reading order without CSS
- Use logical inset and margin properties
- Create a positioning context with position: relative on the owning component
A common mistake
Absolute positioning removes an element from normal flow, so nearby content will not reserve space for it.
Guided practice
Name the positioning value that keeps an element in flow while allowing an offset.
- Copy the example into the editable notebook below.
- Change one thing at a time and keep the program or rule valid.
- Explain the result in one sentence without relying on jargon.