Warning: Trying to access array offset on value of type bool in /home/yotigory/codingmania.net/public_html/wp-content/plugins/search-everything/config.php on line 29
フォームにある現在地を示すステップナビゲーション - CodingMania

2018/3/5

フォームにある現在地を示すステップナビゲーション

フォームの入力ステップをわかりやすく示すためのステップバーです。

ステップが進めばclassにcurrentを指定します。それで色が付きます。

HTMl

<div class="Stepnav">
  <ol>
    <li class="current">1<span>.製品情報入力</span></li>
    <li>2<span>.問合せ情報入力</span></li>
    <li>3<span>.お客様情報入力</span></li>
    <li>4<span>.確認</span></li>
    <li>5<span>.送信完了</span></li>
  </ol>
<!-- /.Stepnav --></div>

CSS

/* Stepnav
-----------------------------------------*/

.Stepnav ol {
  margin-top: 40px;
  display: table;
  table-layout: fixed;
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  border-left: solid 1px #cccccc;
  border-right: solid 1px #cccccc;
}

.Stepnav ol li {
  position: relative;
  display: table-cell;
  box-sizing: border-box;
  padding-left: 25px;
  text-align: center;
  vertical-align: middle;
  color: #2196f3;
  font-size: 14px;
  background-color: #f9f9f9;
  font-weight: bold;
  border-top: solid 1px #cccccc;
  border-bottom: solid 1px #cccccc;
}

.Stepnav ol li:first-child {
  padding-left: 0;
}

@media screen and (max-width: 960px) {
  .Stepnav ol li {
    font-size: 12px;
  }
}

.Stepnav ol li.current {
  background-color: #2196f3;
  color: #FFF;
}

@media screen and (max-width: 960px) {
  .Stepnav ol li span {
    display: none;
  }
}

.Stepnav ol li:before {
  content: "";
  position: absolute;
  top: -1px;
  right: -25px;
  bottom: 0;
  width: 0;
  height: 0;
  border-top: 24px solid transparent;
  border-bottom: 24px solid transparent;
  border-left: 24px solid #cccccc;
  z-index: 99;
}

.Stepnav ol li:nth-child(5):before {
  display: none;
}

.Stepnav ol li:after {
  content: "";
  position: absolute;
  top: -1px;
  right: -24px;
  bottom: 0;
  width: 0;
  height: 0;
  border-top: 24px solid transparent;
  border-bottom: 24px solid transparent;
  border-left: 24px solid #f9f9f9;
  z-index: 99;
}

.Stepnav ol li:last-child:after {
  display: none;
}



.Stepnav ol li.current {
  border-top: solid 1px #2196f3;
  border-bottom: solid 1px #2196f3;
}

.Stepnav ol li.current:after {
  border-left: 24px solid #2196f3;
}