<div class="caption">flex-wrap: wrap;</div>
<div class="flex-container-wrap">
  <div>
    <p>1</p>
  </div>
  <div>
    <p>2</p>
  </div>
  <div>
    <p>3</p>
  </div>
  <div>
    <p>4</p>
  </div>
  <div>
    <p>5</p>
  </div>
  <div>
    <p>6</p>
  </div>
  <div>
    <p>7</p>
  </div>
  <div>
    <p>8</p>
  </div>
  <div>
    <p>9</p>
  </div>
     <div>
    <p>10</p>
  </div>
   <div>
    <p>11</p>
  </div>
   <div>
    <p>12</p>
  </div>
   <div>
    <p>13</p>
  </div>
   <div>
    <p>14</p>
  </div>
   <div>
    <p>15</p>
  </div>
</div>
<div class="caption">flex-wrap: wrap-reverse;</div>
<div class="flex-container-wrap-reverse">
  <div>
    <p>1</p>
  </div>
  <div>
    <p>2</p>
  </div>
  <div>
    <p>3</p>
  </div>
  <div>
    <p>4</p>
  </div>
  <div>
    <p>5</p>
  </div>
  <div>
    <p>6</p>
  </div>
  <div>
    <p>7</p>
  </div>
  <div>
    <p>8</p>
  </div>
  <div>
    <p>9</p>
  </div>
   <div>
    <p>10</p>
  </div>
   <div>
    <p>11</p>
  </div>
   <div>
    <p>12</p>
  </div>
   <div>
    <p>13</p>
  </div>
   <div>
    <p>14</p>
  </div>
   <div>
    <p>15</p>
  </div>
</div>
.flex-container-wrap, .flex-container-wrap-reverse {
  display: flex;
  background-color: lighten(darkorange, 20%);
  border: 1px solid black;
  margin-left: auto;
  margin-right: auto;
  margin-bottom:10px;
  width: 260px;

  
  & div {
    border: 1px solid black;
    width: 30px;
    height: 30px;
    background-color: darkorange;
    margin: 5px;
  }
  
  p {
    text-align: center;
    margin:0;
    margin-top: 0.3em;
  }
}

.flex-container-wrap {
  flex-wrap: wrap;
}

.flex-container-wrap-reverse {
    flex-wrap: wrap-reverse;
}

.caption {
  text-align: center;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.