css3-雪花飘落效果

    <style>
        *{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        html,body{
            width: 100%;
            height: 100%;
        }
        body{
            background-image: url('./img/b.jpeg');
            background-size: 100% 100%;
            background-repeat: no-repeat;
            overflow: hidden;
        }
        .sn{
            width: 100%;
            height: 100%;
            position: absolute;
            left: 0;
            top: 0;
        }
        .sn .snow{
            width: 100%;
            height: 100%;
            background-image: url('./img/xt.png');
            background-position: 0 0;
            background-size: cover;
            position: absolute;
            left: 0;
            top: 0;
        }
        .sn .snow-1{
            filter: blur(4px);
            animation: animate1 15s linear infinite;
        }
        .sn .snow-2{
            filter: blur(3px);
            animation: animate2 15s linear infinite;
            background-size: 800px;
        }
        .sn .snow-3{
            filter: blur(1px);
            animation: animate3 15s linear infinite;
            background-size: 300px;
       
        }
        @keyframes animate1{
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: 150px 100vh;
            }
        }
        @keyframes animate2{
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: 300px 800px;
            }
        }
        @keyframes animate3{
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: 0100vh;
            }
        }
    </style>
</head>
<body>
    <section class="sn">
    <span class="snow snow-1"></span>
    <span class="snow snow-2"></span>
    <span class="snow snow-3"></span>
</section>
</body>

效果图

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值