Style flex Property
Style flex Property
The flex property is used to either set or return the length of the item. It is relative to the rest of the flexible items inside the same container. It will only work if items are flexible. We can say it is the shorthand property of the following properties:-
- flexGrow
- flexShrink
- flexBasis
Syntax:-
Its syntax is:- object.style.flex OR object.style.flex = flex-grow flex-shrink flex-basis|auto|initial|inherit
Return:-
Its return is:- string having flex property of an element
Further Explanation:-
flex-grow | A number specifying how much the item will grow relative to the rest of the flexible items |
flex-shrink | A number specifying how much the item will shrink relative to the rest of the flexible items |
flex-basis | The length of the item. Values can be auto or in numerical form. |
auto | Same as 1 1 auto. |
initial | Same as 0 1 auto. |
none | Same as 0 0 auto. |
inherit | Inherits this property from its parent element. |