【发布时间】:2020-11-21 10:50:12
【问题描述】:
我们正在尝试显示连接 7 点线的进度条。但是填充进度条线时进度条点没有正确对齐。
.progress-bar {
position: relative;
display: inline-block;
height: 40px;
width: 630px;
background: linear-gradient(to right, #8fe4bf 99.9%, transparent 99.9%), radial-gradient(50px circle at 50%, #8fe4bf 10%, transparent 0%);
background-position: 0% 50%, 50% 50%;
background-size: 100% 3px, 80px 70px;
/* 5px is the thickness of the bar, 50px is 1/8th of the height */
background-repeat: no-repeat, repeat-x;
}
.progress-now {
position: absolute;
height: 100%;
background: linear-gradient(to right, #00b164 99.9%, transparent 99.9%), radial-gradient(50px circle at 50% 50%, #00b164 10%, transparent 0%);
background-position: 0% 50%, 50% 50%;
background-size: 100% 3px, 80px 50px;
background-repeat: no-repeat, repeat-x;
z-index: 1;
width: 60%;
}
<div class="progress-bar">
<div class="progress-now" id="progress-now" role="progressnow">
</div>
</div>
<div class="progress-container">
<div class="progress-bar">
<div class="progress-now" id="progress-now" role="progressnow">
</div>
</div>
</div>
这是填充这样的东西,没有填充适当的位置,我们怎么能这样做。我们已经为我们的代码推荐了Progress bar made of solid line, with dots as steps。请添加一些建议,以便更改宽度不会影响线上点的位置。谢谢。
【问题讨论】:
标签: html css progress-bar css-shapes