liveBook · Manning

Justify-content

The CSS justify-content property distributes flex items or grid tracks along the relevant container axis when free space is available.

How 4 Manning books explain it

Web Design Playground, Second Edition

The CSS justify-content property controls how flex or grid items are distributed along their container's main axis.

How it is used
Arranges flex items along a container’s main axis, from simple centering to spacing items in page layouts.
How deep it goes
Defines six values, compares their visible effects, and works through centering; does not descend into layout internals.
Examples
Uses a centered heading, a photo-gallery header, and portfolio images spread with space-between.
What you can do after
Apply it via CSS to center flex items or distribute them across a container.

Read how Web Design Playground, Second Edition explains justify-content →

Tiny CSS Projects

The CSS justify-content property controls how free space is distributed along the main axis of a flex or grid layout.

How it is used
Positions flex children by distributing leftover space, from centering a profile card to separating credit-card details.
How deep it goes
Explains four values through layout rules and shows why unequal item widths can make a space-around row look off-center.
Examples
Shows a centered profile card and actions, spaced profile statistics, and details arranged across a virtual credit card.
What you can do after
Apply it via CSS Flexbox to center children or distribute them across a container, while checking gaps and unequal widths.

Read how Tiny CSS Projects explains justify-content →

Web Design Playground

A CSS alignment property that distributes and aligns items along the main axis of a flex container or grid container.

How it is used
Arranges flex items along the container’s main axis, including centering page content or aligning a nested column at its start.
How deep it goes
Defines five values and explains their placement, default, and `space-around` gap behavior; does not develop layout internals.
Examples
Uses an interactive value playground, a window-centered heading, and nested flex containers in a portfolio layout.
What you can do after
Operate/configure it by choosing a CSS value that positions flex items along the main axis.

Read how Web Design Playground explains justify-content →

CSS in Depth, Second Edition

The CSS justify-content property distributes grid tracks or flex items along the container's inline or main axis when free space is available.

How it is used
Positions flex items or grid tracks along the relevant horizontal or main axis when free space remains.
How deep it goes
Explains core values, logical-direction behavior, spacing differences, and calculation order, while deferring exhaustive examples.
Examples
Demonstrates a centered stylized price using flex items and positions grid tracks within an oversized grid container.
What you can do after
Apply justify-content to center, edge-align, or distribute flex items and grid tracks according to available space.

Read how CSS in Depth, Second Edition explains justify-content →

Also covered in

What to know first

Related concepts

Questions about justify-content

What is justify-content?

The CSS justify-content property distributes flex items or grid tracks along the relevant container axis when free space is available.

Which Manning books explain justify-content?

Web Design Playground, Second Edition, Tiny CSS Projects, Web Design Playground and CSS in Depth, Second Edition.

What should I know before learning justify-content?

Manning books that teach justify-content usually introduce body element, viewport, display property and flexbox first.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.