<h2>flex-direction</h2>
<div class="wrap flex f-wrap">
  <div class="item w150">
    <h3>row(初期値)</h3>
    <div class="wrap flex f-direRow">
      <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>row-reverse</h3>
    <div class="wrap flex f-direRowRev">
      <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>column</h3>
    <div class="wrap flex f-direCol">
      <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>column-reverse</h3>
    <div class="wrap flex f-direColRev">
      <div class="miniItem">1</div>
      <div class="miniItem">2</div>
      <div class="miniItem">3</div>
      <div class="miniItem">4</div>
    </div>
  </div>
</div>

<h2>flex-wrap</h2>
<div class="wrap flex f-wrap">
  <div class="item w150">
    <h3>nowrap(初期値)</h3>
    <div class="wrap flex f-nowrap">
      <div class="miniItem">1</div>
      <div class="miniItem">2</div>
      <div class="miniItem">3</div>
      <div class="miniItem">4</div>
      <div class="miniItem">5</div>
      <div class="miniItem">6</div>
      <div class="miniItem">7</div>
      <div class="miniItem">8</div>
    </div>
  </div>
  <div class="item w150">
    <h3>wrap</h3>
    <div class="wrap flex f-wrap">
      <div class="miniItem">1</div>
      <div class="miniItem">2</div>
      <div class="miniItem">3</div>
      <div class="miniItem">4</div>
      <div class="miniItem">5</div>
      <div class="miniItem">6</div>
      <div class="miniItem">7</div>
      <div class="miniItem">8</div>
    </div>
  </div>
  <div class="item w150">
    <h3>wrap-reverse</h3>
    <div class="wrap flex f-wrapRev">
      <div class="miniItem">1</div>
      <div class="miniItem">2</div>
      <div class="miniItem">3</div>
      <div class="miniItem">4</div>
      <div class="miniItem">5</div>
      <div class="miniItem">6</div>
      <div class="miniItem">7</div>
      <div class="miniItem">8</div>
    </div>
  </div>
</div>

<h2>flex-flow</h2>
<div class="wrap flex f-wrap">
  <div class="item w150">
    <h3>row nowrap(初期値)</h3>
    <div class="wrap flex f-flow">
      <div class="miniItem">1</div>
      <div class="miniItem">2</div>
      <div class="miniItem">3</div>
      <div class="miniItem">4</div>
      <div class="miniItem">5</div>
      <div class="miniItem">6</div>
      <div class="miniItem">7</div>
      <div class="miniItem">8</div>
    </div>
  </div>
</div>
/* 子要素の配置順 */
.f-direRow {
  -webkit-flex-direction: row;
  flex-direction: row;
}
.f-direRowRev {
  -webkit-flex-direction: row-reverse;
  flex-direction: row-reverse;
}
.f-direCol {
  -webkit-flex-direction: column;
  flex-direction: column;
}
.f-direColRev {
  -webkit-flex-direction: column-reverse;
  flex-direction: column-reverse;
}
/* 子要素の折り返し */
.f-noWrap {
  -webkit-flex-wrap: nowrap;
  flex-wrap: nowrap;
}
.f-wrap {
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
}
.f-wrapRev {
  -webkit-flex-wrap: wrap-reverse;
  flex-wrap: wrap-reverse;
}
/* 子要素の配置と折り返し(パターンが多いので例のみ) */
.f-flow {
  -webkit-flex-flow: row nowrap;
  flex-flow: row nowrap;
}
/* 基本flex */
.flex {
  display: -webkit-flex;
  display: flex;
}

/* 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.