html - CSS动画进度条从下往上运行

标签 html css css-animations keyframe

我有这个 CSS 动画,进度条从屏幕顶部运行到底部我想反转它以便它从屏幕底部运行到顶部。

.meter9 {
  position: absolute;
  left: 80%;
  top: 0%;
  width: 5%;
  height: 100%;
  overflow: hidden;
  background-color: transparent;
}

.meter9 span {
  display: block;
  height: 100%;
}

.progress9 {
  background-color: #d6185e;
  animation: progressBar1 3s ease-in-out;
  animation-fill-mode: forwards;
}

@keyframes progressBar1 {
  0% {
    height: 0;
  }
  100% {
    height: 100%;
  }
}
<div class="meter9">
  <span style="width:100%;"><span class="progress9"></span></span>
</div>

最佳答案

设置:

position: absolute;
bottom: 0;
width: 100%;

到 .meter9 跨度,所以它会在底部,然后会增长到顶部。

.meter9 { 
  top:0%;
  left: 80%;
  width: 5%;
  height: 100%;
  position: absolute;
   overflow: hidden;
   background-color: transparent;
}

.meter9 span {
  display: block;
  height: 100%;
  position: absolute;
  bottom: 0;
  width: 100%;
}

.progress9 {
  background-color: #d6185e;
  animation: progressBar1 3s ease-in-out;
  animation-fill-mode:forwards; 
}

@keyframes progressBar1 {
  0% { height: 0; }
  100% { height: 100%; }
}
<div class="meter9">
    <span style="width:100%;"><span class="progress9"></span></span>
</div>

关于html - CSS动画进度条从下往上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48887647/

相关文章:

html - css3微调器上的抽搐动画

jquery - 调整div大小的两个问题

html - CSS定位溢出

html - Lightgallery 不工作

html - 我该如何修复这种对齐方式?

html - Safari 浏览器在图像上显示模糊动画以实现缩放和不透明度 CSS 动画

html - 如何将我的@keyframes 声明内联到我的 HTML/SVG 中?

html - 如何以正确的方式用 div 装箱?

javascript - HTML javascript : expanding function changes the level relationship incorrectly

html - 具有不同屏幕显示的 CSS 动画中的元素位置