<div class="wrap flex f-wrap">
  <div class="item w150">
    <h3>auto(初期値)</h3>
    <div class="wrap flex h100">
      <div class="miniItem f-asStr">1</div>
      <div class="miniItem f-asAuto">2</div>
      <div class="miniItem f-asStr">3</div>
    </div>
  </div>
  <div class="item w150">
    <h3>flex-start</h3>
    <div class="wrap flex h100">
      <div class="miniItem f-asStr">1</div>
      <div class="miniItem f-asSta">2</div>
      <div class="miniItem f-asStr">3</div>
    </div>
  </div>
  <div class="item w150">
    <h3>flex-end</h3>
    <div class="wrap flex h100">
      <div class="miniItem f-asStr">1</div>
      <div class="miniItem f-asEnd">2</div>
      <div class="miniItem f-asStr">3</div>
    </div>
  </div>
  <div class="item w150">
    <h3>center</h3>
    <div class="wrap flex h100">
      <div class="miniItem f-asStr">1</div>
      <div class="miniItem f-asCen">2</div>
      <div class="miniItem f-asStr">3</div>
    </div>
  </div>
  <div class="item w150">
    <h3>stretch</h3>
    <div class="wrap flex h100">
      <div class="miniItem f-asStr">1</div>
      <div class="miniItem f-asStr">2</div>
      <div class="miniItem f-asStr">3</div>
    </div>
  </div>
  <div class="item w150">
    <h3>baseline</h3>
    <div class="wrap flex h100">
      <div class="miniItem f-asStr">1</div>
      <div class="miniItem f-asBas">2</div>
      <div class="miniItem f-asStr">3</div>
    </div>
  </div>
</div>
/* 垂直方向の揃えalign-self */
.f-asAuto {
  align-self: auto;
}
.f-asSta {
  align-self: flex-start;
}
.f-asEnd {
  align-self: flex-end;
}
.f-asCen {
  align-self: center;
}
.f-asStr {
  align-self: stretch;
}
.f-asBas {
  align-self: baseline;
}


/* 基本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;
}
p {
  font-size: .8rem;
}
.wrap {
  border: 1px solid #ccc;
}
.inWrap {
  border: 1px solid #ccc;
  width : 150px;
}
.item {
  border: 1px solid #ccc;
  padding: 5px;
  margin: 5px;
  text-align: center;
  box-sizing: border-box;
}
.miniItem {
  width: 30%;
  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);
}
.w100 {width: 100px;}
.w150 {
  width: 150px;
}
.h100 {
  height: 100px;
}
.w50per {width:50%;}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.