Steps 步驟表示
呈現流程頁中步驟的進度。
規則
內部定義 | 放置位置 |
---|---|
PC版 M版 |
|
|
- |
分頁器 (paginator)
SAMPLE
-
1身份驗證
-
2填寫申請書
-
3上傳文件
-
4完成申請
-
1身份驗證
-
2填寫申請書
-
3上傳文件
HTML
<div class="steps">
<ul class="stepsList">
<li class="stepsName">
<div class="stepsNum">1</div>
<div class="stepsTxt">身份驗證</div>
</li>
<li class="stepsName todo">
<div class="stepsNum">2</div>
<div class="stepsTxt">填寫申請書</div>
</li>
<li class="stepsName todo">
<div class="stepsNum">3</div>
<div class="stepsTxt">上傳文件</div>
</li>
<li class="stepsName todo">
<div class="stepsNum">4</div>
<div class="stepsTxt">完成申請</div>
</li>
</ul>
</div>
<div class="steps">
<ul class="stepsList">
/*done為已完成*/
<li class="stepsName done">
<div class="stepsNum">1</div>
<div class="stepsTxt">身份驗證</div>
</li>
<li class="stepsName ">
<div class="stepsNum">2</div>
<div class="stepsTxt">填寫申請書</div>
</li>
/*todo為即將執行*/
<li class="stepsName todo">
<div class="stepsNum">3</div>
<div class="stepsTxt">完成申請</div>
</li>
</ul>
</div>
複製
CSS
.steps {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.steps .stepsList {
list-style: none;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
margin: 10px 0;
padding: 0;
}
.steps .stepsList .stepsName {
background-color: #00a19b;
border-radius: 50px;
color: #FFFFFF;
font-size: 14px;
margin: 6px;
padding: 5px 15px 5px 6px;
text-align: center;
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.steps .stepsList .stepsName::after {
content: "";
width: 40px;
height: 4px;
position: absolute;
background: #D9D9D9;
margin: auto;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
right: -40px;
}
.steps .stepsList .stepsName:last-child::after {
display: none;
}
@media (min-width: 992px) {
.steps .stepsList .stepsName {
margin: 16px 8px;
font-size: 18px;
width: 186px;
padding: 10px;
}
.steps .stepsList .stepsName::after {
content: "";
width: 60px;
right: -60px;
}
}
.steps .stepsList .stepsName .stepsNum {
width: 24px;
height: 24px;
text-align: center;
line-height: 22px;
border-radius: 100%;
background-color: #00a19b;
padding: 0;
margin: 0;
}
.steps .stepsList .stepsName .stepsTxt {
vertical-align: middle;
}
@media (max-width: 768px) {
.steps .stepsList .stepsName .stepsTxt {
width: 100px;
font-size: 16px;
padding: 2px 0;
}
}
.steps .stepsList .done {
background-color: transparent;
}
@media (max-width: 768px) {
.steps .stepsList .done {
padding-right: 6px;
margin: 0;
}
}
.steps .stepsList .done::after {
content: "";
width: 40px;
height: 4px;
position: absolute;
background: #00a19b;
margin: auto;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
right: -40px;
}
@media (max-width: 768px) {
.steps .stepsList .done::after {
right: -28px;
}
}
@media (min-width: 768px) {
.steps .stepsList .done {
background-color: #00a19b;
}
.steps .stepsList .done::after {
content: "";
width: 60px;
right: -60px;
}
}
.steps .stepsList .done .stepsTxt {
display: none;
}
@media (min-width: 768px) {
.steps .stepsList .done .stepsTxt {
display: block;
}
}
.steps .stepsList .todo {
background-color: transparent;
padding: 5px 0 5px 6px;
}
@media (min-width: 768px) {
.steps .stepsList .todo {
background-color: #D9D9D9;
padding: 5px 15px 5px 6px;
}
}
.steps .stepsList .todo .stepsNum {
background-color: #D9D9D9;
color: #1c1c1c;
}
.steps .stepsList .todo .stepsTxt {
color: #1c1c1c;
display: none;
}
@media (min-width: 768px) {
.steps .stepsList .todo .stepsTxt {
display: block;
}
}
複製