liveBook · Manning

Flex-direction

The CSS flex-direction property specifies the main-axis direction and ordering in which flex items are laid out within a flex container.

How 3 Manning books explain it

Web Design Playground, Second Edition

The CSS flex-direction property specifies the direction in which flex items are placed along the main axis of a flex container.

How it is used
Chooses whether a flex container’s items run horizontally or vertically.
How deep it goes
Defines the main and cross axes, lists four direction values, and identifies the default; leaves alignment to separate properties.
Examples
Shows direction values in CSS and uses a column layout to place photo captions below thumbnails.
What you can do after
Apply it via CSS to choose a flex container’s item direction, including a vertical thumbnail-and-caption layout.

Read how Web Design Playground, Second Edition explains flex-direction →

Web Design Playground

A CSS flexbox property that sets the direction of the main axis and the order in which flex items flow.

How it is used
Sets the direction of flex items in page layouts, including nested containers in a portfolio.
How deep it goes
Defines the main and cross axes and all four direction values, then applies row and column in a layout.
Examples
Uses div layouts with reversed directions and a portfolio with a centered row containing a top-aligned column.
What you can do after
Operate/configure it by choosing row or column flow for flex containers and reversing that flow when needed.

Read how Web Design Playground explains flex-direction →

CSS in Depth, Second Edition

The CSS flex-direction property specifies the main-axis direction and ordering of flex items in a flex container.

How it is used
Controls whether flex items flow horizontally, vertically, or in reverse order within a flex container.
How deep it goes
Explains axis rotation, nested containers, and height-dependent growth, while deferring broader alignment and spacing options.
Examples
Uses a two-column page with a taller main tile and vertically stacked sidebar tiles that must align at the bottom.
What you can do after
Apply it via CSS to stack, reverse, or redistribute flex items and to build height-filling nested layouts.

Read how CSS in Depth, Second Edition explains flex-direction →

Also covered in

What to know first

Related concepts

Questions about flex-direction

What is flex-direction?

The CSS flex-direction property specifies the main-axis direction and ordering in which flex items are laid out within a flex container.

Which Manning books explain flex-direction?

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

What should I know before learning flex-direction?

Manning books that teach flex-direction usually introduce 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.