<ul class="gallery">
  <li>1</li>
  <li>2</li>
  <li>3</li>
  <li>4</li>
  <li>5</li>
  <li>6</li> 
</ul>
* {
  box-sizing: border-box;
}
.gallery {
  height: 150vh;
  padding: 0;
  margin: 0;
  list-style-type: none;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  color: white;
  text-align: center;
}
.gallery li {
  order: 1;
  flex: 1 1 20%;
  margin: 5px;
  /*width: 30%;*/
}
.gallery li:nth-child(3n+1) {
  background: red;
  order: 0;
  flex: 2 0 40%;
  /*width: 60%;*/
}
.gallery li:nth-child(3n+2) {
  background: black;
}
.gallery li:nth-child(3n+3) {
  background: green;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.