Cross axis
The layout axis perpendicular to a flex container's main axis, along which items can be aligned.
CSS in Depth, Second Edition
The cross axis is the layout direction perpendicular to a flex container's main axis.
- How it is used
- Guides alignment decisions by identifying the direction perpendicular to a flex container’s item flow.
- How deep it goes
- Defines the axis, follows its rotation in a column layout, and distinguishes item alignment from spacing wrapped rows.
- Examples
- Uses a flex-container diagram and a nested column sidebar whose tiles grow vertically.
- What you can do after
- Operate/configure CSS flexbox alignment by choosing controls for items or wrapped rows after identifying the cross axis.
Web Design Playground, Second Edition
The cross axis is the direction perpendicular to the main axis in a flex container.
- How it is used
- Guides decisions about item alignment perpendicular to a flex container’s main axis.
- How deep it goes
- Defines both axes and identifies the properties used for item and line alignment, without descending into browser internals.
- Examples
- Uses a horizontal header whose logo and title are centered on the vertical cross axis.
- What you can do after
- Operate/configure it with CSS Flexbox to choose cross-axis alignment for items and wrapped lines.
Read how Web Design Playground, Second Edition explains cross axis →
Web Design Playground
The axis perpendicular to the main axis in a flex container along which items can be aligned.
- How it is used
- Guides decisions about how flex items align perpendicular to their direction of travel.
- How deep it goes
- Defines the axis relative to the main axis and shows alignment choices, without descending into layout internals.
- Examples
- Uses a flex header, row-direction CSS, and align-items value listings.
- What you can do after
- Operate/configure cross-axis alignment with CSS Flexbox properties.
Related concepts
- align-itemsused by · The CSS align-items property specifies how items are aligned along a container’s cross axis in flexbox and grid layouts.
- main axiscontrasts with · The main axis is the primary direction in which a flex container arranges and distributes its flex items.
- flex-directionconfigured by · The CSS flex-direction property specifies the main-axis direction and ordering in which flex items are laid out within a flex container.
- flexboxused by · Flexbox is a CSS one-dimensional layout model for arranging, sizing, aligning, and distributing items along a row or column.
Questions about cross axis
What is cross axis?
The layout axis perpendicular to a flex container's main axis, along which items can be aligned.
Which Manning books explain cross axis?
CSS in Depth, Second Edition, Web Design Playground, Second Edition and Web Design Playground.
What is the difference between cross axis and main axis?
The layout axis perpendicular to a flex container's main axis, along which items can be aligned. The main axis is the primary direction in which a flex container arranges and distributes its flex items.
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.


