CSS
π― CSS flex-flow Property
The flex-flow CSS shorthand property combines flex-direction and flex-wrap into a single declaration.
It defines both the direction of flex items and whether they should wrap or not.
πΉ Why Use flex-flow?
-
Benefits
- π Combines direction + wrapping in one property
- π Simplifies Flexbox code
- π Improves readability and maintainability
- π Essential for responsive layouts
π§© Examples
Example 1:
CSS
.container {
display: flex;
flex-flow: row wrap;
}
This means: items are arranged horizontally and will wrap onto a new line if needed.
Example 2:
CSS
.container {
display: flex;
flex-flow: column nowrap;
}
This means: items are arranged vertically and will never wrap.
-
π§ Quick Summary
- flex-flow β shorthand for flex-direction + flex-wrap
- row β horizontal layout
- column β vertical layout
- wrap β allows wrapping to new lines
- nowrap β prevents wrapping
- wrap-reverse β reverse wrapping direction
- initial β resets to default
