我正在尝试使用这个进度步骤向导,它工作正常但是当我尝试添加引导程序css时,一切都搞砸了,我不知道什么是错的。
这是一个小提琴手 https://jsfiddle.net/gy2gqns1/
.step-wizard {
display: inline-block;
position: relative;
width: 100%;
}
.step-wizard .swprogress {
position: absolute;
top: 43px;
left: 12.5%;
width: 75%;
}
.step-wizard .swprogressbar {
position: absolute;
background-color: #0aa89e;
opacity: 0.4;
height: 12px;
border: 1px solid e5e6e6;
width: 0%;
-webkit-transition: width 0.6s ease;
-o-transition: width 0.6s ease;
transition: width 0.6s ease;
}
.step-wizard .swprogressbar.swempty {
opacity: 1;
width: 100%;
background-color: #e5e6e6;
}
.step-wizard ul {
position: absolute;
width: 100%;
list-style-type: none;
padding: 0;
left: -2%;
}
.step-wizard li {
display: inline-block;
text-align: center;
width: 24.7%;
}
.step-wizard li .swstep {
position: absolute;
display: inline-block;
line-height: 30px;
width: 30px;
height: 30px;
border-radius: 50%;
border: 4px solid;
border-color: #e5e6e6;
background: #ffffff;
-webkit-transition: background-color 0.6s ease, border-color 0.6s ease;
-o-transition: background-color 0.6s ease, border-color 0.6s ease;
transition: background-color 0.6s ease, border-color 0.6s ease;
}
.step-wizard li .swtitle {
position: absolute;
width: 100%;
left: 20px;
padding-top: 42px;
color: #969c9c;
-webkit-transition: color 0.6s ease;
-o-transition: color 0.6s ease;
transition: color 0.6s ease;
}
.step-wizard li.swactive .swstep {
border-color: #0aa89e;
}
.step-wizard li.swactive .swtitle {
color: black;
}
.step-wizard li.swdone .swstep {
color: white;
background-color: #0aa89e;
border-color: #0aa89e;
}
.step-wizard li > a {
display: block;
width: 100%;
color: black;
position: relative;
text-align: center;
}
.step-wizard li > a:hover .swstep {
border-color: #0aa89eg;
}
.step-wizard li > a:hover .swtitle {
color: black;
}
@media only screen and (max-width: 1200px) {
.step-wizard li {
width: 24%;
}
}
@media only screen and (max-width: 375px) {
.step-wizard li {
width: 22%;
}
}
<body>
<div id="container">
<div class="step-wizard">
<div class="swprogress">
<div class="swprogressbar swempty"></div>
<div id="prog" class="swprogressbar" style="width:33.3%"></div>
</div>
<ul>
<li class="swactive">
<a href="#" id="step1">
<span class="swstep">1</span>
<span class="swtitle">Client Details</span>
</a>
</li>
<li class="swactive">
<a href="#" id="step2">
<span class="swstep">2</span>
<span class="swtitle">Brand Details</span>
</a>
</li>
<li class="">
<a href="#" id="step3">
<span class="swstep">3</span>
<span class="swtitle">Shift Details</span>
</a>
</li>
<li class="">
<a href="#" id="step4">
<span class="swstep">4</span>
<span class="swtitle">Confirmation</span>
</a>
</li>
</ul>
</div>
</div>
答案 0 :(得分:0)
Bootstrap将子样式添加到覆盖你的样式的ul ad。 如果你的风格几乎没有改正,你可以通过bs修正修改:
.step-wizard {
display: inline-block;
position: relative;
width: 100%;
}
.step-wizard .swprogress {
position: absolute;
top: 43px;
left: 12.5%;
width: 75%;
}
.step-wizard .swprogressbar {
position: absolute;
background-color: #0aa89e;
opacity: 0.4;
height: 12px;
border: 1px solid e5e6e6;
width: 0%;
-webkit-transition: width 0.6s ease;
-o-transition: width 0.6s ease;
transition: width 0.6s ease;
}
.step-wizard .swprogressbar.swempty {
opacity: 1;
width: 100%;
background-color: #e5e6e6;
}
.step-wizard ul {
position: absolute;
width: 100%;
list-style-type: none;
padding: 0;
left: -2%;
margin-top:16px; /* Style correction */
}
.step-wizard li {
display: inline-block;
text-align: center;
width: 24.7%;
}
.step-wizard li .swstep {
position: absolute;
display: inline-block;
line-height: 30px;
width: 38px; /* Style correction */
height: 38px; /* Style correction */
border-radius: 50%;
border: 4px solid;
border-color: #e5e6e6;
background: #ffffff;
-webkit-transition: background-color 0.6s ease, border-color 0.6s ease;
-o-transition: background-color 0.6s ease, border-color 0.6s ease;
transition: background-color 0.6s ease, border-color 0.6s ease;
}
.step-wizard li .swtitle {
position: absolute;
width: 100%;
left: 20px;
padding-top: 42px;
color: #969c9c;
-webkit-transition: color 0.6s ease;
-o-transition: color 0.6s ease;
transition: color 0.6s ease;
}
.step-wizard li.swactive .swstep {
border-color: #0aa89e;
}
.step-wizard li.swactive .swtitle {
color: black;
}
.step-wizard li.swdone .swstep {
color: white;
background-color: #0aa89e;
border-color: #0aa89e;
}
.step-wizard li > a {
display: block;
width: 100%;
color: black;
position: relative;
text-align: center;
}
.step-wizard li > a:hover .swstep {
border-color: #0aa89eg;
}
.step-wizard li > a:hover .swtitle {
color: black;
}
@media only screen and (max-width: 1200px) {
.step-wizard li {
width: 24%;
}
}
@media only screen and (max-width: 375px) {
.step-wizard li {
width: 22%;
}
}