JSFiddle - React, Tailwind, and code Playground

by Mayank0619

HTML

<ul class="flex-container">
  <li class="flex-listing">1</li>
  <li class="flex-listing">2</li>
  <li class="flex-listing">3</li>
  <li class="flex-listing">4</li>
  <li class="flex-listing">5</li>
</ul>

CSS

.flex-container {
  padding: 0;
  margin: 0;
  list-style: none;
  
  -ms-box-orient: horizontal;
  display: flex;
  
  -webkit-flex-flow: row wrap;
  flex-flow: row wrap;
}

.flex-listing:nth-of-type(1) { order: 3; }
.flex-listing:nth-of-type(2) { order: 4; }
.flex-listing:nth-of-type(3) { order: 1; }
.flex-listing:nth-of-type(4) { order: 5; }
.flex-listing:nth-of-type(5) { order: 2; }

.flex-listing {
  height: 200px;
  margin: 5px;
  line-height: 100px;
  color: #000;
  background: #eee;
  padding: 5px;
  width: 200px;
  align-items: center;
  font-size: 16px;
  text-align: center;
}