css实现Loading 效果

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Loading</title>
    <style>
        .app {
            width: 100%;
            height: 100%;
            display: flex;
            position: fixed;
            top: 0;
            left: 0;
            align-items: center;
            justify-content: center;
            background: #333333;
        }
        .loadBox{
            width: 100px;
            height: 100px;
            top: -50px;
            position: relative;
        }
        .loadBox span{
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #f3f3f3;
            position: absolute;
            -webkit-animation: load 1.04s ease infinite;
        }
        @-webkit-keyframes load{
            0%{
                opacity: 1;
            }
            100%{
                opacity: 0.2;
            }
        }
        .loadBox span:nth-child(1){
            left: 0;
            top: 50%;
            margin: -10px 0 0 -10px;
            -webkit-animation-delay:0.13s;
        }
        .loadBox span:nth-child(2){
            left: 25%;
            top: 25%;
            margin: -10px 0 0 -10px;
            -webkit-animation-delay:0.26s;
        }
        .loadBox span:nth-child(3){
            left: 50%;
            top: 0;
            margin: -10px 0 0 -10px;
            -webkit-animation-delay:0.39s;
        }
        .loadBox span:nth-child(4){
            top: 25%;
            right: 25%;
            margin: -10px -10px 0 0;
            -webkit-animation-delay:0.52s;
        }
        .loadBox span:nth-child(5){
            right: 0;
            top: 50%;
            margin: -10px -10px 0 0;
            -webkit-animation-delay:0.65s;
        }
        .loadBox span:nth-child(6){
            right: 25%;
            top: 75%;
            margin: -10px -10px 0 0;
            -webkit-animation-delay:0.78s;
        }
        .loadBox span:nth-child(7){
            bottom: 0;
            left: 50%;
            margin: 0 0 -10px -10px;
            -webkit-animation-delay:0.91s;
        }
        .loadBox span:nth-child(8){
            bottom: 25%;
            left: 25%;
            margin: 0 0 -10px -10px;
            -webkit-animation-delay:1.04s;
        }
    </style>
</head>
<body>
    <div class="app">
        <div class="loadBox">
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
        </div>
    </div>

</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值