这是一款基于Bootstrap的进度条美化特效。该特效在原生Bootstrap进度条的基础上,对进度条的各个组件进行了美化,效果非常炫酷。
使用方法
在页面中引入bootstrat相关文件和font-awesome文件。
<link href="path/to/css/font-awesome.min.css" rel="stylesheet"> <link href="path/to/css/bootstrap.min.css" rel="stylesheet">
HTML结构
该Bootstrap进度条的HTML结构如下:
<div class="container"> <div class="row"> <div class="col-md-offset-3 col-md-6"> <h3 class="progress-title">HTML5</h3> <div class="progress"> <div class="progress-bar" style="width:85%; background:#cc504c;"></div> <span class="progress-value">[85%]</span> </div> <h3 class="progress-title">CSS3</h3> <div class="progress"> <div class="progress-bar" style="width:60%; background:#5cb85c;"></div> <span class="progress-value">[60%]</span> </div> <h3 class="progress-title">JQuery</h3> <div class="progress"> <div class="progress-bar" style="width:90%; background:#5bc0de;"></div> <span class="progress-value">[90%]</span> </div> <h3 class="progress-title">Bootstrap</h3> <div class="progress"> <div class="progress-bar" style="width:75%; background:#efac4d;"></div> <span class="progress-value">[75%]</span> </div> </div> </div> </div>
CSS样式
为该Bootstrap进度条添加下面的美化CSS样式。
.progress-title{ font-size: 16px; font-weight: 600; letter-spacing: 0.7px; color: #D5D6E2; text-transform: uppercase; margin: 10px 0 5px; } .progress{ height: 5px; background: #d6d6d6; border-radius: 0; box-shadow: none; margin-bottom: 40px; overflow: visible; position: relative; } .progress .progress-bar{ position: relative; -webkit-animation: animate-positive 2s; animation: animate-positive 2s; } .progress .progress-bar:after{ content: "\f041"; font-family: 'FontAwesome'; position: absolute; top: -20px; right: -7px; font-size: 25px; font-weight: 700; color: #D5D6E2; } .progress .progress-value{ display: block; font-size: 12px; color: #D5D6E2; position: absolute; top: -23px; right: 0; } @-webkit-keyframes animate-positive{ 0% { width: 0%; } } @keyframes animate-positive{ 0% { width: 0%; } }