Table of Contents
CSS Parent / Child
—the structural relationship
that gives a layout its shape
Every element on a page lives inside something.
A parent creates the context,
and a child lives within that context.
This relationship is the backbone of CSS
— the quiet structure that determines how
elements behave, align, and interact.
A parent:
- defines the space the child can occupy
- sets the rules the child must follow
- shapes the flow and alignment inside it
- passes down constraints, tone, and rhythm
A child:
- inherits context from its parent
- respects the parent’s boundaries
- flows, aligns, and sizes itself within that space
- cannot escape without explicit instruction
More than hierarchy, this relationship is about meaning.
When we understand it,
we can describe structure with precision.
Examples of how to say it:
“Keep this child inside its parent.”
“Do not change the parent–child relationship.”
“Move the child, not the parent.”
“Let the parent grow to fit its children.”
The parent–child model is the simplest way to
understand how CSS builds the world.
Why Parent / Child matters when working with AI
AI needs to know where a change belongs.
When we name the parent and the child, we define:
- the scope of the change
- the relationships that must remain stable
- the boundaries that protect the layout
- the meaning of the structure
This prevents accidental rewrites
and keeps the collaboration predictable.
Related concepts
- Containment — the space the parent creates
- Flow — how children move inside the parent
- Siblings — children at the same level
- Hierarchy — how structure expresses importance
Tony de Araujo —New York | Lisbon
