<div class="main">
	<div class="box">■1</div>
	<div class="box">■2</div>
	<div class="box">■3</div>
	<div class="box">■4</div>
	<div class="box">■5</div>
</div>
.main {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;

     -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
     -ms-flex-direction: row;
         flex-direction: row;

  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
}

.main {
  width: 60px;
}

.box {
  margin: auto;
}

.main {
  border: 1px solid red;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.