html - 进度指示器从进度条外开始

标签 html css

最左边的进度指示器最初是从进度条外开始的,如果我去掉右边,它会回到正确的位置:-10%;但是当我更改 pro-bar 的内联 css 中的宽度时,进度指示器不会移动。 如何解决这个问题。

.progress_bar{
    height: 15px;
    background-color:grey;
    border-radius:15px;
    box-shadow:0 4px 7px -5px #000 inset;
}
.progress_bar:first-child{
    margin: 50px 0;
}
.progress_bar .pro-bar{
    position: relative;
    height: 100%;
    box-shadow: 0 1px 11px -4px #fff inset;
    border-radius:15px;
    animation: animate-positive 4s;
}
.progress_bar .pro-bar > span{
    background: linear-gradient(to top, #3d4131 35%, #fff 233%);
    color: #a5a5a4;
    box-shadow: 1px 1px  3px #1d1a1f;
    font-size: 14px;
    font-weight: 700;
    position: absolute;
    top: -37px;
    right: -10%;
    padding: 4px 10px;
    border-radius: 3px 3px 3px 0px;
}
.progress_bar .pro-bar > span:after{
    content: "";
    border-top: 6px solid #3d4131;
    border-right: 6px solid transparent;
    position: absolute;
    bottom: -6px;
    left:0;
}
.pro-bar {
   background: linear-gradient(to right,#d98164 35%,#a9b487 68%);
}
<div class="row">
<div class="col-xs-9 progress-container">

        <div class="col-md-6">
            <div class="progress_bar">
                <div class="pro-bar" style="width: 0%">
                    <span>0%</span>
                </div>
            </div>
 
        </div>
    </div>
</div>

最佳答案

我想我已经弄明白了,请试试

left: 100%;

代替权:-10%;

关于html - 进度指示器从进度条外开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56034460/

相关文章:

html - 如何让页面并排的2个DIV内容独立向下或向上滚动而不使用框架?

具有可滚动 div 的 CSS,占用 100% 可用高度,但不向主体添加滚动条

CSS 中心 float

css - 位置固定时 macgap 滚动问题

html - 为什么嵌套内联元素和后续字符之间没有字母间距?

javascript - Angular 误差不确定为什么会发生

php - 如何避免在 "infinite scrolling"系统中从数据库中获取重复的帖子?

html - 父级上的边框半径 50% 不圆 Angular

javascript - 在 PHP 中查询嵌套的 HTML 标签以返回其属性的值

javascript - 我想要在 BootStrap Carousel 中的悬停元素上实现 1 x 1 滑动和悬停效果