Bootstrap step wizard サンプル4

Flexboxで作るstep wizard

表示サンプル

STEP.1

お申込み

コメントを記載する欄

STEP.2

お申込内容の確認

コメントを記載する欄

STEP.3

送信

コメントを記載する欄

STEP.4

完了

コメントを記載する欄

HTML

<div class="row row-steps mb-20">
  <div class="col-md-3">
    <h3 class="steps-title">
      <p class="text-green"><b>STEP.1</b></p>
      <p>お申込み</p>
    </h3>
    <p class="form-explain">コメントを記載する欄</p>
  </div>
  <div class="col-md-3 col-steps">
    <h3 class="steps-title">
      <p class="text-green"><b>STEP.2</b></p>
      <p>お申込内容の確認</p>
    </h3>
    <p class="form-explain">コメントを記載する欄</p>
  </div>
  <div class="col-md-3 col-steps">
    <h3 class="steps-title">
      <p class="text-green"><b>STEP.3</b></p>
      <p>送信</p>
    </h3>
    <p class="form-explain">コメントを記載する欄</p>
  </div>
  <div class="col-md-3 col-steps">
    <h3 class="steps-title">
      <p class="text-green"><b>STEP.4</b></p>
      <p>完了</p>
    </h3>
    <p class="form-explain">コメントを記載する欄</p>
  </div>
</div>

CSS

<style>
.steps-title {
  width: 100%;
  margin: 0 .5em 1em 0em;
  background: #eaeebb;
  text-decoration: none;
  color: #444;
  position: relative;
  height: 100px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-flow: column nowrap;
}

.form-explain {
  min-height: 5em;
}

.steps-title::after {
  content: " ";
  display: block;
  width: 0;
  height: 0;
  border-top: 50px solid transparent;
  border-bottom: 50px solid transparent;
  border-left: 30px solid #eaeebb;
  position: absolute;
  top: 50%;
  margin-top: -50px;
  left: 100%;
  z-index: 2;
}

@media print, screen and (max-width: 768px) {
  .steps-title {
    width: 80%;
    margin: 0 auto 30px;
    background: #eaeebb;
    text-decoration: none;
    color: #444;
    position: relative;
    height: auto;
    text-align: center;
    padding: 10px;
  }
  .steps-title::after {
    content: "";
    display: block;
    border-top: 20px solid #eaeebb !important;
    border-right: 38vw solid transparent !important;
    border-left: 38vw solid transparent !important;
    border-bottom: none;
    position: absolute;
    width: 0;
    height: 0;
    bottom: -20px !important;
    top: auto !important;
    left: 50%;
    margin-top: 0 !important;
    margin-left: -38vw;
  }
}

</style>