HTML | DOM Style flexFlow Property
The Style flexFlow property in HTML DOM is used to specify the value for two different properties flexDirection property and flexWrap property. The flexDirection property is used to specify the direction of flexible items and flexWrap property is used to specify the flexible item should wrap or not.
Syntax:
- It returns the string which represents the flexFlow property of an element.
object.style.flexFlow
- It is used to set the flexFlow property value.
object.style.flexFlow = "flex-direction flex-wrap|initial| inherit"
Property Values:
- flex-direction flex-wrap: The flewFlow property is the combination of flexDirection and flexWrap property. The default value of flex-direction flex-wrap is row nowrap. Following are the list of possible values of flexDirection and flexWrap properties.
flex-direction = "row |row-reverse |column |column-reverse | initial |inherit";
flex-wrap = "nowrap |wrap |wrap-reverse |initial |inherit";
Example 1: It changes the flexFlow property value from “row wrap” to “column wrap”.
<!DOCTYPE html><html><head><title>HTML DOM Style flexFlow Property</title><style>#GFG {width: 220px;height: 150px;border: 2px solid black;/* For Safari browsers */display: -webkit-flex;/* For Safari 6.1+ browsers */-webkit-flex-flow: row wrap;display: flex;flex-flow: row wrap;}#GFG div {width: 50px;height: 70px;}</style></head><body><divid="GFG"><divstyle="background-color:lightgreen;">G</div><divstyle="background-color:green;">E</div><divstyle="background-color:lightgreen;">E</div><divstyle="background-color:green;">K</div><divstyle="background-color:lightgreen;">S</div></div><buttononclick="myGeek()">Click Here</button><script>function myGeek() {/* For Safari Browsers */document.getElementById("GFG").style.WebkitFlexFlow= "column wrap";document.getElementById("GFG").style.FlexFlow= "column wrap";}</script></body></html>chevron_rightfilter_noneOutput:
Before click on the button:

After click on the button:

- Example 2: It changes the flexFlow property value from “row wrap” to “row-reverse wrap-reverse”.
<!DOCTYPE html><html><head><title>HTML DOM Style flexFlow Property</title><style>#GFG {width: 220px;height: 150px;border: 2px solid black;/* For Safari browsers */display: -webkit-flex;/* For Safari 6.1+ browsers */-webkit-flex-flow: row wrap;display: flex;flex-flow: row wrap;}#GFG div {width: 50px;height: 70px;}</style></head><body><divid="GFG"><divstyle="background-color:lightgreen;">G</div><divstyle="background-color:green;">E</div><divstyle="background-color:lightgreen;">E</div><divstyle="background-color:green;">K</div><divstyle="background-color:lightgreen;">S</div></div><buttononclick="myGeek()">Click Here</button><script>function myGeek() {/* For Safari Browsers */document.getElementById("GFG").style.WebkitFlexFlow= "row-reverse wrap-reverse";document.getElementById("GFG").style.FlexFlow= "row-reverse wrap-reverse";}</script></body></html>chevron_rightfilter_noneOutput:
Before click on the button:

After click on the button:

- initial: It set the flexFlow property to its default value.
Example 3:<!DOCTYPE html><html><head><title>HTML DOM Style flexFlow Property</title><style>#GFG {width: 220px;height: 150px;border: 2px solid black;/* For Safari browsers */display: -webkit-flex;/* For Safari 6.1+ browsers */-webkit-flex-flow: row wrap;display: flex;flex-flow: row wrap;}#GFG div {width: 50px;height: 70px;}</style></head><body><divid="GFG"><divstyle="background-color:lightgreen;">G</div><divstyle="background-color:green;">E</div><divstyle="background-color:lightgreen;">E</div><divstyle="background-color:green;">K</div><divstyle="background-color:lightgreen;">S</div></div><buttononclick="myGeek()">Click Here</button><script>function myGeek() {/* For Safari Browsers */document.getElementById("GFG").style.WebkitFlexFlow= "initial";document.getElementById("GFG").style.FlexFlow= "initial";}</script></body></html>chevron_rightfilter_noneOutput:
Before click on the button:

After click on the button:

- inherit: It inherits the property from its parent element.
Example 4:
<!DOCTYPE html><html><head><title>HTML DOM Style flexFlow Property</title><style>#GFG {width: 220px;height: 150px;border: 2px solid black;/* For Safari browsers */display: -webkit-flex;/* For Safari 6.1+ browsers */-webkit-flex-flow: row wrap;display: flex;flex-flow: row wrap;}#GFG div {width: 50px;height: 70px;}</style></head><body><divid="GFG"><divstyle="background-color:lightgreen;">G</div><divstyle="background-color:green;">E</div><divstyle="background-color:lightgreen;">E</div><divstyle="background-color:green;">K</div><divstyle="background-color:lightgreen;">S</div></div><buttononclick="myGeek()">Click Here</button><script>function myGeek() {/* For Safari Browsers */document.getElementById("GFG").style.WebkitFlexFlow= "inherit";document.getElementById("GFG").style.FlexFlow= "inherit";}</script></body></html>chevron_rightfilter_noneOutput:
Before click on the button:

After click on the button:

Supported Browsers: The browser supported by DOM Style flexFlow property are listed below:
- Google Chrome
- Internet Explorer 11.0
- Firefox
- Opera
- Safari 6.1 WebkitFlexFlow
Recommended Posts:
- HTML | DOM Style right Property
- HTML | DOM Style top Property
- HTML | DOM Style isolation Property
- HTML | DOM Style cssFloat Property
- HTML | DOM Style transitionProperty Property
- HTML | DOM Style position Property
- HTML | DOM Style clear Property
- HTML | DOM Style order Property
- HTML | DOM Style columnFill Property
- HTML | DOM Style perspective Property
- HTML | DOM Style backgroundColor Property
- HTML | DOM Style flexBasis Property
- HTML | DOM Style wordSpacing Property
- HTML | DOM Style textAlign Property
- HTML | DOM Style visibility Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



