<返回更多

使用CSS渐变制作进度条

2022-09-27  今日头条  一个爬坑的Coder
加入收藏

效果图:

 

 

 

<div class="container"> 
  <div class="inner"></div>
	<div class="percentage" style="height: 17%"></div>
</div>
body {
  background: #e4e4e4;
}
.container {
  width: 20px;
  height: 180px;
  position: relative;
}

.inner {
  width: 20px;
  height: 180px;
  background: linear-gradient(0deg, #2d4264 50%, #0a1431 50%);
  background-size: 100% 6px;
}
.percentage {
  position: absolute;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to bottom, #24a1d8 0%, #3e25c8 100%);
}

.percentage::before {
  content: "";
  position: absolute;
  bottom: 0;
  height: 180px;
  width: 20px;
  background: linear-gradient(0deg, transparent 50%, #0a1431 50%);
  background-size: 100% 6px;
}
  • 整体流程

 

 

声明:本站部分内容来自互联网,如有版权侵犯或其他问题请与我们联系,我们将立即删除或处理。
▍相关推荐
更多资讯 >>>