flex in CSS – What Is Flexbox's flex Property?
flex is a shorthand for the
In other words, instead of writing:
You can alternatively use the
flex property to shorten your code like so:
flex: 0.5 0 100px;
Note the following:
flex: autois equivalent to
flex: 1 1 auto.
flex: noneis equivalent to
flex: 0 0 auto.
flex: initialsets the
flexproperty to its default value. It is equivalent to
flex: 0 1 auto.
flex: inheritinherits its parent element's