flex-flow
W3C CSS Snapshot 2026
Set flex-direction and flex-wrap in one declaration. The keywords can appear in either order.
On this page
Syntax and values
| Value or syntax | What it does |
|---|---|
row nowrap | The initial combination. Uses a single row. |
row wrap | Lays out a row and allows further lines. |
column wrap | Stacks items and can start a new column when height is constrained. |
wrap-reverse | Sets wrapping and resets the omitted direction to row. |
Try the example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>flex-flow example</title>
<style>
.layout { display: flex; width: min(100%, 320px); border: 2px solid teal; box-sizing: border-box; }
.layout > div { padding: 8px 12px; background: #def5f5; color: #123; border: 1px solid #81b9b5; box-sizing: border-box; }
.layout { flex-flow: column wrap; height: 90px; gap: 6px; }
.layout > div { flex: 0 0 37px; }
</style>
</head>
<body>
<div class="layout">
<div class="first">A</div>
<div class="second">B</div>
<div>C</div>
</div>
</body>
</html>
What to expect A and B stack in the first column, and C starts a new one. Change column to row to compare.