flex wrap css tricks code example

Example 1: flex wrap css

<style> 
#datadiv {
  width: 200px;
  height: 200px;
  border: 1px solid #c3c3c3;
  display: flex;
  flex-wrap: wrap;
}

#datadiv div {
  width: 50px;
  height: 50px;
}
</style>
</head>
<body>

<h1>The flex-wrap Property</h1>

<div id="datadiv">
  <div style="background-color:red;">A</div>
  <div style="background-color:green;">B</div>
  <div style="background-color:yellow;">C</div>
  <div style="background-color:blue;">D</div>
  <div style="background-color:cyan;">E</div>
  <div style="background-color:indigo;">F</div>
</div>

Example 2: flex parameters

flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]

Example 3: flex box css tricks

.container {
  flex-direction: row | row-reverse | column | column-reverse;
}