纯CSS3仿bootstrap动态进度条

效果展示:

代码展示:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>纯CSS3仿bootstrap动态进度条</title>
    <style>
        .progress {
            height: 20px;
            margin-bottom: 20px;
            overflow: hidden;
            background-color: #f5f5f5;
            border-radius: 4px;
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
        }

        .progress-bar {
            float: left;
            width: 0;
            height: 100%;
            font-size: 12px;
            line-height: 20px;
            color: #fff;
            text-align: center;
            background-color: #337ab7;
            box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
            transition: width .6s ease;
        }

        .progress-bar-danger {
            background-color: #d9534f;
        }

        .progress-striped .progress-bar, .progress-bar-striped {
            background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
            background-size: 40px 40px;
        }

        .progress.active .progress-bar, .active {
            animation: progress-bar-stripes 2s linear infinite;
        }

        @keyframes progress-bar-stripes {
            from {
                background-position: 40px 0;
            }
            to {
                background-position: 0 0;
            }
        }

        .aa {
            width: 500px;
            height: 30px;
        }

        .bb {
            width: 200px;
            height: 100%;
        }

    </style>
</head>
<body>
<div class="progress aa">
    <div class="progress-bar progress-bar-danger progress-bar-striped active bb"></div>
</div>
</body>
</html>



<!--核心代码-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>纯CSS3仿bootstrap动态进度条</title>
    <style>
        div{
            width: 800px;
            height: 40px;
            border: 1px solid #000;
            border-radius: 5px;
            background-color: #d9534f;  /*背景色  底色*/
            /*background-image: url("a.gif");*/
            /*自定义渐变重复效果*/
            background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);

            background-size: 40px 40px;  /*设置大小*/
            animation: a 2s linear infinite ;
        }
        /*动画*/
        @keyframes a {
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: 40px 0;
            }

        }

    </style>
</head>
<body>
<div></div>

</body>
</html>

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值