树叶飘落动画

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>树叶飘落动画</title>
    <style type="text/css">
        *{
            padding: 0;
            margin: 0;
        }
        ul,ol{
            list-style: none;
        }
        a{
            text-decoration: none;
            color: #000000;
        }

        section{
            height: 600px;
            border-bottom: 1px solid #000000;
            position: relative;
        }
        .big{
            /*利用定位调整树叶位置*/
            position: absolute;
            width: 240px;
            height: 152px;
            background: url("image/page.png");
            left: 400px;
            bottom: 150px;
        }
        .small{
            position: absolute;
            width: 89px;
            height: 63px;
            background: url("image/page.png") 0 -152px;
            left: 250px;
            top: 50px;
            /*调用动画*/
            -webkit-animation: leaf 5s linear 0s infinite;
        }
        /*定义动画*/
        @-webkit-keyframes leaf {
            0%{
                /*在天上准备掉落 opacity(透明度)*/
                opacity: 0;
                /*移动 旋转 每一个状态样式属性必须一一对应*/
                /*一个元素可以有多个变形 用空格隔开*/
                transform: rotate(0deg) translate(0,0);
            }
            30%{
                /*掉落在空中*/
                opacity: 1;
                transform: rotate(5deg) translate(200px,180px);
            }
            60%{
                /*掉落在地下*/
                opacity: 0;
                transform: rotate(10deg) translate(400px,360px);
            }
            100%{
                /*利用60-100对应的时间模拟等待*/
                opacity: 0;
                transform: rotate(10deg) translate(400px,360px);
            }
        }

    </style>
</head>
<body>
    <section>
        <div class="big"></div>
        <div class="small"></div>
    </section>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值