我想帮助整合2年前制作素描的设计!目标是做一个漂亮的订货人名单,但我很难整合内容。
这就是我到目前为止所做的:
HTML:
<div class="stepbar_block">
<ol class="stepbar_list">
<li class="stepbar_list_elem_active"> 50% </li>
<li class="stepbar_list_item">60% </li>
<li class="stepbar_list_item">70%</li>
<li class="stepbar_list_elem_current">80%</li>
<li class="stepbar_list_item">90%</li>
</ol>
</div>
CSS:
.stepbar_block {
margin: 0;
padding: 0;
counter-reset: step;
position: relative;
margin-top: 40px;
}
.stepbar_block:before {
width: 1px;
height :10px;
background-color : rgba(87,87,86,0.3);
content : '';
position : absolute;
left : 30px;
top : -4px;
}
.stepbar_block:after {
width: 1px;
height :10px;
background-color : rgba(87,87,86,0.3);
content : '';
position : absolute;
right : 30px;
top : -4px;
}
.stepbar_list li {
list-style-type: none;
float: left;
width: 20%;
height : 5px;
position: relative;
font-family: Roboto;
font-size: 10px;
line-height: 11px;
text-align: center;
color: rgba(87,87,86,0.5);
}
.stepbar_list:after {
content: '';
position: absolute;
height: 1px;
background-color: rgba(87,87,86,0.3);
left: 30px;
right: 30px;
z-index: 3;
}
.stepbar_list li:before {
content : '';
counter-increment: step;
width: 5px;
height: 5px;
border: 1px solid black;
display: block;
background-color : black;
border-radius: 40px;
text-align: center;
margin: -2px auto 10px auto;
}
.stepbar_list_item:after {
content: counter(step);
position: absolute;
top: -25px;
background-color: white;
left: 0;
right: 0;
color: rgba(87,87,86,0.5);
font-size: 10px;
line-height: 11px; text-align: center;
}
.stepbar_list_elem_active:after {
content: counter(step);
position: absolute;
top: -25px;
background-color: red;
left: 0;
right: 0;
}
.stepbar_list_elem_current:after {
content: counter(step);
position: absolute;
top: -25px;
background-color: blue;
left: 0;
right: 0;
}
https://jsfiddle.net/zawt9hL6/
然而,我能够将项目着色而不是圈子,所以我想知道什么是缺失的,因为当我玩时:之前和之后:它似乎着色整个列表项而不是特定内容
这是我想要的结果
可以有这样的渲染吗?此外,它是圆圈的渐变背景。
感谢你的建议
答案 0 :(得分:0)
对所有人使用这样的东西。
.stepbar_list_elem_active:before {
width: 10px;
height: 10px;
background-color: #fff;
content: '';
position: absolute;
left: 0;
top: -6px;
border: 2px solid red;
border-radius: 50%;
right: 0;
margin: 0 auto;
}
答案 1 :(得分:0)
您可以使用:before
和:after
伪元素来创建具有渐变的圆圈。首先,您可以创建具有渐变的常规圆,然后在第一个圆顶上添加一个带有其他伪元素的白色圆圈。
10* {
box-sizing: border-box;
}
ul {
display: inline-flex;
list-style: none;
position: relative;
padding: 0;
margin: 0 50px;
}
ul:after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 2px;
background: gray;
}
li {
padding: 25px;
position: relative;
}
li:after,
li.color:before {
position: absolute;
content: '';
bottom: 0;
left: 50%;
height: 10px;
width: 10px;
background: gray;
border-radius: 50%;
transform: translate(-50%, 40%);
z-index: 1;
}
li.color:after {
width: 20px;
height: 20px;
transform: translate(-50%, 9px);
}
li.color:before {
background: white;
z-index: 2;
width: 10px;
height: 10px;
}
li.yellow:after {
background: linear-gradient(to right, rgba(240,184,88,1) 0%, rgba(230,139,60,1) 38%, rgba(240,47,23,1) 71%, rgba(231,56,39,1) 100%);
}
li.blue:after {
background: linear-gradient(to right, rgba(52,163,247,1) 0%, rgba(52,163,247,1) 32%, rgba(19,100,158,1) 71%, rgba(19,100,158,1) 100%);
}
.yellow {
color: #ED4620;
}
.blue {
color: #64A3D1;
}
<ul>
<li>1</li>
<li class="color yellow">2</li>
<li class="color blue">3</li>
<li>4</li>
</ul>