进度条编写

 

<style>
.mui-progressbar {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    height: 2px;
    -webkit-transform-origin: center top;
    transform-origin: center top;
    vertical-align: middle;
    border-radius: 2px;
    background: #b6b6b6;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    }
    
    .mui-progressbar span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-transition: 150ms;
    transition: 150ms;
    -webkit-transform: translate3d(-100%,0,0);
    transform: translate3d(-100%,0,0);
    background: #007aff;
}
    
</style>

<p class="mui-progressbar mui-progressbar-in" data-progress="20"><span style="transform: translate3d(-70%, 0px, 0px);"></span></p>

注意:控制红色的部分 -70% 比例就好,使用100-20=70,加上负号和百分比就OK

 

posted @ 2019-10-10 09:04  骚年丶勿忘初心。  阅读(282)  评论(0编辑  收藏  举报