CKTIS / CSS
flex-flow — flex direction and wrapping
The flex-flow shorthand sets flex-direction and flex-wrap together on a flex container. It determines the main-axis direction and whether items can move onto additional lines.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
flex-flow: <'flex-direction'> || <'flex-wrap'>;flex-flow combines flex-direction and flex-wrap. Apply it to a container with display: flex or display: inline-flex; it does not enable flex layout by itself. The initial setting is row nowrap; the property is not inherited.
The || operator allows either component alone or both in either order. An omitted component resets to its initial value: flex-flow: column means column nowrap, even if wrap was set earlier.
flex-direction accepts row, row-reverse, column, or column-reverse. The basic flex-wrap values are nowrap, wrap, and wrap-reverse; the last reverses line stacking along the cross axis. Directions depend on writing-mode and direction, not simply physical horizontal and vertical directions. Reversal values leave document order and the default sequential focus order unchanged. However, reversal can change the keyboard navigation order when the container uses reading-flow: flex-visual.
The example uses row wrap: a width of 210px fits two 100px items and a 10px gap, so C moves to the next row. flex: 0 0 100px disables item growth and shrinking. The Level 2 draft extends wrapping with balance; this entry does not assume support for it in the target browser.
Examples
<!doctype html>
<meta charset="utf-8">
<title>flex-flow</title>
<style>
.items {
display: flex;
flex-flow: row wrap;
writing-mode: horizontal-tb;
direction: ltr;
width: 210px;
gap: 10px;
}
.items > span {
flex: 0 0 100px;
height: 40px;
background: lightblue;
}
</style>
<div class="items"><span>A</span><span>B</span><span>C</span></div>Result
A B C
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.