<div class="main">
  <div class="rows">
    <div>
      <p>flex-direction: row; (default)</p>
      <div class="row">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
        <div class="item">5</div>
      </div>
    </div>
    <div>
      <p>flex-direction: row-reverse;</p>
      <div class="row row-reverse">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
        <div class="item">5</div>
      </div>
    </div>
  </div>
  <div class="columns">
    <div>
      <div> flex-direction: <br>column; (default)</div>
      <div class="column">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
      </div>
    </div>
    <div>
      <div> flex-direction: <br>column-reverse;</div>
      <div class="column column-reverse">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
      </div>
    </div>
  </div>
</div>
.main {
  display: flex;
  justify-content: center;

  .rows {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    .row {
      background-color: lighten(darkorange, 20%);
      display: flex;
      border: 1px solid black;
      width: 300px;
    }

    .row-reverse {
      flex-direction: row-reverse;
    }
  }

  .columns {
    display: flex;
    justify-content: space-around;
    text-align: center;

    .column {
      background-color: lighten(darkorange, 20%);
      display: flex;
      border: 1px solid black;
      flex-direction: column;
      width: 42px;
      margin-left: 50px;
      margin-right: 50px;
      margin-top: 15px;
      height: 200px;
    }

    .column-reverse {
      flex-direction: column-reverse;
    }
  }

  .item {
    border: 1px solid black;
    margin: 5px;
    width: 30px;
    height: 30px;
    text-align: center;
    background-color: darkorange;
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.