超简单CSS3水平动态进度条+小圆球+背景色渐变

实现的的效果图如下:效果是动态加载的

代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
//为了将效果图移到屏幕中间的盒子
.box{
width: 200px;
margin: 50px auto;
}
//包含进度条和圆圈的盒子
.line {
border-radius: 10px;
height: 10px;
margin-top: 6px;
animation: loader 3s linear;
position: relative;
}
//有背景色的进度条
.line_in {
border-radius: 10px;
height: 5px;
margin-top: 6px;
}
//进度条前面的圆圈
.circle {
position: absolute;
top: -2px;
right: 0px;
width: 10px;
height: 10px;
border-radius: 50%;
}
//背景色实现渐变
.green {
background-image: linear-gradient(
-45deg,
rgba(99, 193, 111, 1) 0%,
rgba(20, 157, 37, 1) 25%,
rgba(99, 193, 111, 1) 50%,
rgba(20, 157, 37, 1) 75%,
rgba(99, 193, 111, 1) 100%
);
}
//进度条能动态加载的动画
@keyframes loader {
0% {width: 0%;}
100% { width: 80%;}
}
</style>
</head>
<body>
<div class="box">
   <div class="line" style="width:80%">
       <div class="line_in green"></div>
       <div class="circle green"></div>
   </div>
</div>
<script src="./js/jquery/jquery.min.js"></script>
</body>
</html>
 

 

posted @ 2017-09-01 17:13  MissSu  阅读(708)  评论(0编辑  收藏  举报