Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Flexbox

The flex-flow property

Reference for the CSS flex-flow shorthand: set flex-direction and flex-wrap in one declaration, with accepted orders, defaults and live examples.

The flex-flow property is a shorthand that sets flex-direction and flex-wrap together. Both describe the "flow" of a flex container: which way items run, and whether they may start a new line when they run out of room.

The two values can be written in either order. Anything you leave out is reset to its initial value.

CSS
.tags { display: flex; flex-flow: row wrap; }
.stack { display: flex; flex-flow: column nowrap; }

Try it

Row wrap versus column wrap

Syntax

CSS
flex-flow: <'flex-direction'> || <'flex-wrap'>;

flex-flow: row;
flex-flow: column wrap;
flex-flow: wrap-reverse column-reverse;
  • Initial value: row nowrap
  • Applies to: flex containers
  • Inherited: no
  • Animatable: no
  • Computed value: as each longhand

Values

Value Description
row, row-reverse, column, column-reverse Sets flex-direction. See flex-direction.
nowrap, wrap, wrap-reverse Sets flex-wrap. See flex-wrap.

Usage notes

  • Omitted parts reset. flex-flow: wrap sets the direction back to row, even if an earlier rule said column. Use the longhands when you only want to change one of them.
  • Order does not matter. row wrap and wrap row are the same.
  • No separate rows and columns. Unlike gap, flex-flow is not about the two axes of space. It is about direction and wrapping.
  • Wrapping needs a limit. Items only wrap if the container has a limited main size. A row container inside a wide parent may never need to wrap. For a column container, give it a height.
  • Wrapped lines are independent. Each line distributes its own free space, so items in different lines do not line up in columns. Use Grid when you need that.

Browser support

Supported in every browser.