When would you use flex-flow property and what is it good for?
Experience Level: Junior
Tags: CSSFlexbox
Answer
The flex-flow
property will save you some time. As it is a shorthand property for flex-direction
property and flex-wrap
property, you can use it at any time when you would be defining both of these properties in your CSS ruleset.
The flex-flow
property is often used for styling navigations and menus or other lists that can items - product cards or application tiles.
The flex-wrap
property defines how the flex container items will be wrapped if they don't fit on one line (or column).
Thanks to this property you don't need to write that many characters. And the CSS has smaller footprint which means it can be downloaded faster.
div {
display: flex;
flex-flow: column nowrap;
}
Related Flexbox job interview questions
How would you use space-between and what do you know about it?
CSSFlexbox JuniorWhy would you use flex-wrap CSS property and what values can it have?
CSSFlexbox JuniorHow does flex-flow property work and what are its advantages?
CSSFlexbox JuniorHow can you explicitly reorder items in a flexbox container?
CSSFlexbox JuniorWhat is a flex-direction property used for and what values can it have?
CSSFlexbox Junior