flex-flex-grow

by loebmraz

HTML

<div class="parent">
  <div class="child1">

  </div>
  <div class="child2">

  </div>
  <div class="child3">

  </div>
  <div class="child4">
  
  </div>
</div>

CSS

.parent {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  height: 200px;
  border: solid 2px green;
}

.child1 {
  order: 3;
  flex-grow: 1;
  background: black;
  height: 30px;
}

.child2 {
  order: 1;
  flex-grow: 1;
  background: yellow;
  height: 30px;
}

.child3 {
  order: 4;
  flex-grow: 3;
  background: red;
  height: 30px;
}

.child4{
  order: -1;
  flex-grow: 2;
  background: blue;
  height: 30px;
}