第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

從右向左停止動(dòng)畫

從右向左停止動(dòng)畫

尚方寶劍之說(shuō) 2024-01-03 14:29:13
我希望這個(gè)進(jìn)度條僅從左到右從文本開始動(dòng)畫。動(dòng)畫從右到左結(jié)束后,它會(huì)從某個(gè)點(diǎn)開始從右到左開始動(dòng)畫。注意,我需要使用彈性框和文本寬度。.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>
查看完整描述

1 回答

?
慕田峪9158850

TA貢獻(xiàn)1794條經(jīng)驗(yàn) 獲得超7個(gè)贊

您需要添加flex-shrink:0以避免文本尖叫,因?yàn)槟谠O(shè)置width:100%

.table-bars .bar-box .text {

  height: 100%;

  margin: 0 30px 0 200px;

  width: 200px;

  text-align: right;

  flex-shrink:0;

}


.bar-box {

  margin-bottom: 20px;

}


.table-bars div .progress {

  background-color: #0071b9;

  border-radius: 20px;

  border-right: 13px solid rgb(0, 173, 239);

  animation: progressBar 2s ease-in-out;

  animation-fill-mode: both;

  height: 20px;

}


@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>

或者用動(dòng)畫flex-grow代替width

.table-bars .bar-box .text {

  height: 100%;

  margin: 0 30px 0 200px;

  width: 200px;

  text-align: right;

  flex-shrink:0;

}


.bar-box {

  margin-bottom: 20px;

}


.table-bars div .progress {

  background-color: #0071b9;

  border-radius: 20px;

  border-right: 13px solid rgb(0, 173, 239);

  animation: progressBar 2s ease-in-out;

  animation-fill-mode: both;

  height: 20px;

}


@keyframes progressBar {

  0% {

    flex-grow: 0;

  }

  100% {

    flex-grow: 1;

  }

}


.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>


查看完整回答
反對(duì) 回復(fù) 2024-01-03
  • 1 回答
  • 0 關(guān)注
  • 127 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)