Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.49 KB

flex.md

File metadata and controls

29 lines (24 loc) · 1.49 KB

flex

The flex CSS shorthand property sets how a flex item will grow or shrink to fit the space available in its flex container.

Values

initial
The item is sized according to its width and height properties. It shrinks to its minimum size to fit the container, but does not grow to absorb any extra free space in the flex container. This is equivalent to setting "flex: 0 1 auto".
auto
The item is sized according to its width and height properties, but grows to absorb any extra free space in the flex container, and shrinks to its minimum size to fit the container. This is equivalent to setting "flex: 1 1 auto".
none
The item is sized according to its width and height properties. It is fully inflexible: it neither shrinks nor grows in relation to the flex container. This is equivalent to setting "flex: 0 0 auto".
<flex-grow>
Defines the flex-grow of the flex item. Negative values are considered invalid. Defaults to 1 when omitted. (initial is 0)
<flex-shrink>
Defines the flex-shrink of the flex item. Negative values are considered invalid. Defaults to 1 when omitted. (initial is 1)
<flex-basis>
Defines the flex-basis of the flex item. A preferred size of 0 must have a unit to avoid being interpreted as a flexibility. Defaults to 0 when omitted. (initial is auto)

Examples

flex="auto"
flex="10em"
flex="30%"
flex="min-content"