The flex-flow property is a shorthand that sets both flex-direction and flex-wrap in one line. It is a quick way to control how flex items flow and whether they wrap onto new lines.
01
Shorthand
Direction + wrap.
02
Default
row nowrap.
03
row wrap
Responsive grids.
04
column wrap
Multi-column flow.
05
Container
On flex parent.
06
Less CSS
One property.
Fundamentals
Introduction
The flex-flow property in CSS is a shorthand property that combines the flex-direction and flex-wrap properties. It defines the direction in which flex items are placed in the flex container and whether they should wrap onto multiple lines.
This property is useful for creating flexible and responsive layouts without needing to write multiple lines of CSS.
Definition and Usage
Apply flex-flow on a flex container alongside display: flex. Use row wrap for tag clouds and card grids, column nowrap for vertical stacks, and column wrap when items should fill columns before moving to the next column.
💡
Beginner Tip
flex-flow: row wrap is the same as writing flex-direction: row; and flex-wrap: wrap; on separate lines.
Foundation
📝 Syntax
The syntax for the flex-flow property is as follows:
syntax.css
element{flex-flow:flex-directionflex-wrap;}
flex-direction — Specifies the direction of the flexible items.
flex-wrap — Specifies whether the flexible items should wrap or not.
The default value for the flex-flow property is row nowrap, which means the flex items are placed in a single line in the row direction.
Syntax Rules
Apply on the flex container, not on flex items.
Order can be direction wrap or wrap direction — the browser detects which is which.
Omitting wrap defaults to nowrap; omitting direction defaults to row.
The property is not inherited.
Use gap for spacing between wrapped items instead of margins when possible.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
row nowrap
Applies to
Flex containers
Inherited
No
Shorthand for
flex-direction + flex-wrap
Common responsive value
row wrap
Reference
💎 Property Values
flex-flow accepts values from both flex-direction and flex-wrap:
flex-direction values
Value
Description
row
Items are placed in a row (default).
row-reverse
Items are placed in a row, but in reverse order.
column
Items are placed in a column.
column-reverse
Items are placed in a column, but in reverse order.
flex-wrap values
Value
Description
nowrap
All flex items will be on one line (default).
wrap
Flex items will wrap onto multiple lines, from top to bottom.
wrap-reverse
Flex items will wrap onto multiple lines, from bottom to top.
Context
Common flex-flow Combinations
flex-flow
Equivalent longhand
Typical use
row nowrap
Default horizontal toolbar
Nav bars, button groups
row wrap
Horizontal with line breaks
Card grids, tags, chips
column nowrap
Vertical single column
Sidebar menus, stacked forms
column wrap
Vertical with column breaks
Masonry-style column layouts
Preview
👀 Live Preview
Six items with flex-flow: row wrap — they wrap to the next line when space runs out:
123456
Hands-On
Examples Gallery
In this example, we’ll create a flex container with items that wrap onto multiple lines and are arranged in a column — plus row wrap grids, default nowrap, and a tag list.
🔀 Direction & Wrapping
Start with the reference example — column direction with wrapping enabled.
Example 1 — Column Wrap Layout
Stack items vertically and allow them to wrap into new columns when the container height is limited.
Tags flow left to right and wrap to new lines when they run out of room, without extra markup or grid columns.
A11y
♿ Accessibility
Wrapping preserves DOM order — screen readers follow source order across wrapped lines.
Avoid horizontal scroll on nowrap toolbars — ensure buttons remain reachable on small screens.
Use semantic lists for tags when tags represent categories or filters.
Test keyboard navigation on wrapped flex rows with many interactive items.
Do not use wrap-reverse for primary navigation without testing focus order.
🧠 How flex-flow Works
1
Direction sets the main axis
The first part of flex-flow chooses row or column flow.
flex-direction
2
Wrap controls line breaks
The second part decides whether items stay on one line or wrap to new lines.
flex-wrap
3
Items fill available space
Flex items are placed along the main axis until a wrap break creates a new line or column.
Layout
=
🔀
Flexible responsive flow
One shorthand controls direction and wrapping for cleaner CSS.
Compatibility
🖥 Browser Compatibility
The flex-flow property is well-supported across all modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. This ensures consistent behavior of flex layouts across different platforms.
✓ Baseline · Universal support
flex-flow everywhere
All direction and wrap combinations work in every modern browser as part of standard Flexbox.
99%Universal support
Google Chrome29+ · Desktop & Mobile
Full support
Mozilla Firefox28+ · Desktop & Mobile
Full support
Apple Safari9+ · macOS & iOS
Full support
Microsoft Edge12+ · All versions
Full support
Opera17+ · Modern versions
Full support
flex-flow property99% supported
Bottom line:flex-flow is safe for all modern projects. Pair row wrap with gap for clean responsive layouts.
Wrap Up
🎉 Conclusion
The flex-flow property is a convenient shorthand for controlling the flow of flex items within a container. By combining the flex-direction and flex-wrap properties, you can efficiently manage the layout and wrapping behavior of your flex items.
This property helps in creating flexible and responsive designs with minimal CSS code, making it an essential tool for modern web development.
Use flex-flow: row wrap for responsive card and tag layouts
Combine with gap instead of margins on every item
Use the shorthand to keep CSS concise
Set a max-width on wrapped containers for readable line lengths
Learn the longhand properties when you need to override one value alone
❌ Don’t
Apply flex-flow on flex items instead of the container
Use nowrap on mobile when items overflow horizontally
Forget display: flex on the parent
Rely on column wrap without setting container height or width
Assume wrap alone creates equal column widths — use flex-basis or flex on items
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about flex-flow
Use these points when building wrapped Flexbox layouts.
5
Core concepts
🔀01
Shorthand
Direction + wrap.
Purpose
→02
row nowrap
Default value.
Default
📂03
row wrap
Responsive grids.
Common
↓04
column wrap
Multi-column flow.
Advanced
📝05
Less CSS
One line setup.
Tip
❓ Frequently Asked Questions
The flex-flow property is a shorthand for flex-direction and flex-wrap. It sets both the main axis direction and whether flex items wrap onto multiple lines in one declaration.
The initial value is row nowrap, meaning items flow horizontally in a single line without wrapping.
flex-direction only sets the main axis direction. flex-flow sets both direction and wrap behavior, equivalent to writing flex-direction and flex-wrap together.
Use row wrap for responsive card grids, tag lists, or toolbars where items should move to the next line when the container runs out of horizontal space.
Yes. If you specify only flex-direction, flex-wrap defaults to nowrap. If you specify only flex-wrap, flex-direction defaults to row.