<h2>justify-content</h2>
<div class="wrap flex f-wrap">
  <div class="item w150">
    <h3>flex-start(初期値)</h3>
    <div class="wrap flex f-jusFsta">
      <div class="miniItem">1</div>
      <div class="miniItem">2</div>
      <div class="miniItem">3</div>
      <div class="miniItem">4</div>
    </div>
  </div>
  <div class="item w150">
    <h3>flex-end</h3>
    <div class="wrap flex f-jusFend">
      <div class="miniItem">1</div>
      <div class="miniItem">2</div>
      <div class="miniItem">3</div>
      <div class="miniItem">4</div>
    </div>
  </div>
  <div class="item w150">
    <h3>center</h3>
    <div class="wrap flex f-jusCen">
      <div class="miniItem">1</div>
      <div class="miniItem">2</div>
      <div class="miniItem">3</div>
      <div class="miniItem">4</div>
    </div>
  </div>
  <div class="item w150">
    <h3>space-between</h3>
    <div class="wrap flex f-jusSpbet">
      <div class="miniItem">1</div>
      <div class="miniItem">2</div>
      <div class="miniItem">3</div>
      <div class="miniItem">4</div>
    </div>
  </div>
  <div class="item w150">
    <h3>space-around</h3>
    <div class="wrap flex f-jusSparo">
      <div class="miniItem">1</div>
      <div class="miniItem">2</div>
      <div class="miniItem">3</div>
      <div class="miniItem">4</div>
    </div>
  </div>
</div>
/* 水平揃え */
.f-jusFsta {
  -webkit-justify-content: flex-start;
  justify-content: flex-start;
}
.f-jusFend {
  -webkit-justify-content: flex-end;
  justify-content: flex-end;
}
.f-jusCen {
  -webkit-justify-content: center;
  justify-content: center;
}
.f-jusSpbet {
  -webkit-justify-content: space-between;
  justify-content: space-between;
}
.f-jusSparo {
  -webkit-justify-content: space-around;
  justify-content: space-around;
}

/* 基本flex */
.flex {
  display: -webkit-flex;
  display: flex;
}
/* 子要素の折り返し */
.f-wrap {
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
}
/* flex以外のプロパティ */
h2,h3 {
  font-size: 1rem;
  font-weight: normal;
  margin: .5em;
}
.wrap {
  border: 1px solid #ccc;
}
.inWrap {
  border: 1px solid #ccc;
  width : 150px;
}
.item {
  border: 1px solid #ccc;
  padding: 5px;
  margin: 5px;
  box-sizing: border-box;
}
.miniItem {
  width: 20px;
  font-size: 10px;
  text-align: center;
  border: 1px solid #ccc;
  padding: 2px;
  margin: 2px;
  box-sizing: border-box;
}
.f-aliBase .miniItem {text-decoration: underline;}
.f-aliBase .miniItem:nth-child(2){font-size: 1em;}
.f-aliBase .miniItem:nth-child(3){font-size: 2em;}
.f-aliBase .miniItem:nth-child(4){font-size: 1.5em;}
.f-aliBase .miniItem:nth-child(5){font-size: 0.8em;}
.col3 {
  width: calc(100% / 3 - 10px);
}
.w150 {
  width: 150px;
}
.h100 {
  height: 100px;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.