<div class="flex">
  <div class="flex__element">1</div>
  <div class="flex__element  flex__element--2">
    2<br><code>order:1</code>
  </div>
  <div class="flex__element">3</div>
  <div class="flex__element  flex__element--4">
    4<br><code>order:-1</code>
  </div>
  <div class="flex__element">5</div>
  <div class="flex__element">6</div>
  <div class="flex__element  flex__element--7">
    7<br><code>order:-2</code>
  </div>
  <div class="flex__element">8</div>
</div>
.flex {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  max-width: 395px;
  margin: 0 auto;
  padding: 5px;
  border: 4px solid gray;
  font-size: 14px;
  line-height: 20px;
}

.flex__element {
  box-sizong: border-box;
  width: 70px;
  margin: 5px;
  padding: 10px 5px;
  border: 2px solid lightgray;
  background-color: coral;
  color: white;
  text-align: center;
}

.flex__element--2 {
  order: 1;
}

.flex__element--4 {
  order: -1;
}

.flex__element--7 {
  order: -2;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.