The CSS flex property is a compact way to set an item’s flex-grow, flex-shrink, and flex-basis values. Think of it as the three-question form for a Flexbox item: may it grow, may it shrink, and what size should it start with? section 12.4
Write the shorthand in several useful forms:
- flex: flex-grow flex-shrink flex-basis; section 12.4
- flex: flex-grow flex-shrink; or flex: flex-grow flex-basis; section 12.4
- flex: flex-grow; or flex: flex-basis; section 12.4
PLAY
Try familiar shorthand combinations: flex: 0 1 auto; flex: 1 0; and flex: 0 0 10em;. Each example sets the item’s flexibility using fewer declarations—CSS doing a little word-saving magic. section 12.4
item {
flex: flex-grow flex-shrink flex-basis;
flex: flex-grow flex-shrink;
flex: flex-grow flex-basis;
flex: flex-grow;
flex: flex-basis;
}
Use the syntax listing to compare the complete and abbreviated flex forms at a glance. section 12.4


