flex-flow
Example
.tags {
display: flex;
flex-flow: row wrap;
}'row wrap' sets flex-direction and flex-wrap in one declaration, so the tags line up in a row and wrap onto new lines.
Common mistakes
- Putting
justify-contentvalues intoflex-flow.
Key points
- The shorthand lists direction and wrap, like
flex-flow: row wrap, not alignment values. - Wrapped rows set
gapfor spacing instead of margins on each item.
Interview questions
What is the default value of flex-flow?
It is row nowrap: items sit in one horizontal line and do not wrap.
Can I set only wrap with flex-flow?
Yes. flex-flow: wrap sets wrapping and resets direction to 'row'.