Gets or sets values that specify the parameters of a flexible length: the positive and negative flexibility, and the preferred size.
This property is read/write.
![]() ![]() |
Syntax
-ms-flex: [ [
<positive-flex>
<negative-flex>
? ] ||
<preferred-size>
] | none
Property values
- positive-flex
-
An integer that sets the positive flexibility.
If omitted, the element's positive flexibility is "1".
A negative value is not valid.
- negative-flex
-
An integer that sets the negative flexibility.
If omitted, the element's negative flexibility is "0".
A negative value is not valid.
- preferred-size
-
Sets the preferred size of the flexbox item. Can be any valid value for the width or height properties, excluding "inherit".
If omitted, the preferred size defaults to "0px".
If the preferred-size component is auto on a child of a flexbox, the preferred size is the value of the flexbox item's width or height property (whichever is parallel to the main axis).
none-
Initial value. Equivalent to setting -ms-flex to "0 0 auto".
CSS information
| Applies To | flexbox items |
|---|---|
| Media | visual |
| Inherited | no |
| Initial Value | none |
Standards information
- Flexible Box Layout Module, Section 7
Remarks
This property makes flexbox items "flex"—adjusting their width or height to fill the available space. A flexbox distributes free space to its items proportional to their positive flexibility, or shrinks them to prevent overflow proportional to their negative flexibility.
When the element containing the -ms-flex property is a flexbox item, the -ms-flex property is consulted instead of the width or height properties to determine the main size of the element. (If an element is not a flexbox item, the -ms-flex property has no effect.)
See also
Send comments about this topic to Microsoft
Build date: 11/29/2012

