我希望这个进度条仅从左到右从文本开始动画。动画从右到左结束后,它会从某个点开始从右到左开始动画。注意,我需要使用弹性框和文本宽度。
.table-bars .bar-box .text {
height: 100%;
margin: 0 30px 0 200px;
width: 200px;
text-align:right;
}
.bar-box {
margin-bottom:20px;
}
.table-bars div .progress {
background-color: #0071b9;
border-radius: 20px;
border-right: 13px solid rgb(0, 173, 239);
-webkit-animation: progressBar 2s ease-in-out;
-webkit-animation-fill-mode:both;
-moz-animation: progressBar 2s ease-in-out;
-moz-animation-fill-mode:both;
height: 20px;
}
@-webkit-keyframes progressBar {
0% { width: 0; }
100% { width: 100%; }
}
@-moz-keyframes progressBar {
0% { width: 0; }
100% { width: 100%; }
}
.bar-box {
display: flex;
}
<div class="table-bars">
<div class="bar-box">
<div class="text"><span>TEXT</span></div>
<div class="progress"></div>
</div>
<div class="bar-box">
<div class="text"><span>Another TEXT</span></div>
<div class="progress"></div>
</div>
</div>
慕田峪9158850
相关分类