欢迎光临
我们一直在努力

CSS3怎么实现彩色进度条动画特效

这篇文章主要介绍“CSS3怎么实现彩色进度条动画特效”,在日常操作中,相信很多人在CSS3怎么实现彩色进度条动画特效问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”CSS3怎么实现彩色进度条动画特效”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

代码设计

利用HBulider开发工具创建jindutiao.html文件,代码如下所示:

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>CSS3彩色进度条动画特效</title>

<link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="css/jindutiao.css"/>

</head>

<body>

<div>

<div>

<div>

<div class="col-md-offset-3 col-md-6">

<h4>HTML5</h4>

<div>

<div style="width:65%; background:#ef2d56;">

<div>65%</div>

</div>

</div>

<h4>CSS3</h4>

<div>

<div style="width:87%; background:#ff9900;">

<div>87%</div>

</div>

</div>

<h4>J-Query</h4>

<div>

<div style="width:55%; background:#82b700;">

<div>55%</div>

</div>

</div>

<h4>PHP</h4>

<div>

<div style="width:95%; background:#00ebdd;">

<div>95%</div>

</div>

</div>

</div>

</div>

</div>

</div>

</body>

<script src="http://cdn.bootcss.com/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>

<script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

</html>

创建style.css用于存放制作进度条的各种样式,代码如下所示:

.demo{ background: #2c304a;padding: 2em 0; }

.progress-title{

font-size: 18px;

font-weight: 700;

color: #fff;

margin: 0 0 20px;

}

.progress{

height: 20px;

background: #171b3c;

border-radius: 20px;

border: 1px solid #000;

box-shadow: 0 2px 2px #4f4c4c;

margin-bottom: 40px;

overflow: visible;

position: relative;

}

.progress .progress-bar{

border-radius: 20px;

border: 1px solid #000;

-webkit-animation: animate-positive 2s;

animation: animate-positive 2s;

}

.progress .progress-value{

width: 65px;

height: 25px;

line-height: 25px;

background: #171b3c;

font-size: 15px;

color: #fff;

border-radius: 0 0 15px 15px;

border: 1px solid #000;

border-top: none;

box-shadow: 0 2px 2px #4f4c4c;

position: absolute;

bottom: -25px;

right: 60px;

}

@-webkit-keyframes animate-positive{

0% { width: 0; }

}

@keyframes animate-positive{

0% { width: 0; }

}

到此,关于“CSS3怎么实现彩色进度条动画特效”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注云搜网网站,小编会继续努力为大家带来更多实用的文章!

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。