HTML+CSS练习 周边游动画

<!DOCTYPE html>
<head>
    <title>Document</title>
    <style>
        html{
            width: 100%;
            height: 100%;
        }
        body{
            height: 100%;
            width: 100%;
            background: url(./images/f1_1.jpg) no-repeat    center 0   /cover ;
        }
        .cloud img{
            position: absolute;
            left: 50%;
        }
        .cloud img:nth-child(1){
            margin-left: -300px;
            top: 50px;
            animation: cloudd 1s linear alternate infinite;
        }
        .cloud img:nth-child(2){
            margin-left: 400px;
            top: 100px;
            animation: cloudd 1s linear alternate infinite 0.6s;
        }
        .cloud img:nth-child(3){
            margin-left: -550px;
            top: 200px;
            animation: cloudd 1s linear alternate infinite 0.9s;
        }

        @keyframes cloudd {
            from{}
            to{
                transform: translateX(20px);
            }
        }

        .balloon{
            position: absolute;
            left: 50%;
            margin-left: -500px;
            top: 20%;
            animation: balloonn 1s linear alternate infinite ;
        }
        @keyframes balloonn {
            from{}
            to{
                transform: translatey(40px);
            }
        }

        .recommend img{
            position: absolute;
            top: 80%;
        }
        .recommend img:nth-child(1){
            margin-left: 20%;
            animation: recommendd 1s linear alternate infinite ;
        }
        .recommend img:nth-child(2){
            margin-left: 35%;
            animation: recommendd 1s linear alternate infinite 0.4s;
        }
        .recommend img:nth-child(3){
            margin-left: 50%;
            animation: recommendd 1s linear alternate infinite 0.8s;
        }
        .recommend img:nth-child(4){
            margin-left: 65%;
            animation: recommendd 1s linear alternate infinite 1.2s;
        }
        @keyframes recommendd {
            from{}
            to{
                transform: translatey(-60px);
            }
        }

        .text{
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
            animation: textt 1s ;
        }
        @keyframes textt {
            0%{
                transform: translate(-50%,-50%) scale(1);
            }
            10%{
                transform: translate(-50%,-50%) scale(0.2);
            }
            20%{
                transform: translate(-50%,-50%) scale(1.6);
            }
            30%{
                transform: translate(-50%,-50%) scale(0.8);
            }
            40%{
                transform: translate(-50%,-50%) scale(1);
            }
        }
    </style>
</head>
<body>
    <div class="cloud">
        <img src="./images/yun1.png" alt="">
        <img src="./images/yun2.png" alt="">
        <img src="./images/yun3.png" alt="">
    </div>
    <div class="balloon">
        <img src="./images/san.png" alt="">
    </div>
    <div class="recommend">
        <img src="./images/1.png" alt="">
        <img src="./images/2.png" alt="">
        <img src="./images/3.png" alt="">
        <img src="./images/4.png" alt="">
    </div>
    <div class="text">
        <img src="./images/font1.png" alt="">
    </div>
</body>
</html>

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值