动画-云层效果

26 篇文章 0 订阅
12 篇文章 0 订阅
本文介绍了如何使用CSS创建逼真的云层动画效果,详细阐述了实现过程和技术要点,为网页设计提供动态视觉元素。
摘要由CSDN通过智能技术生成
效果

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        ul {
            position: relative;

            height: 400px;
            margin-top: 100px;

            background-color: skyblue;

            animation: sky 6s linear infinite alternate;
        }
        @keyframes sky {
            from {
                background-color: skyblue;
            }
            to {
                background-color: #000000;
            }
        }

        ul li {
            position: absolute;
            top: 0;
            left: 0;

            width: 400%;
            height: 400px;
        }

        ul li:nth-child(1) {
            background-image: url(images/carousel/cloud_one.png);
            animation: one 20s linear infinite alternate;
        }
        @keyframes one {
            from {
                margin-left: 0;
            }
            to {
                margin-left: -100%;
            }
        }

        ul li:nth-child(2) {
            background-image: url(images/carousel/cloud_two.png);
            animation: two 20s linear infinite alternate;
        }
        @keyframes two {
            from {
                margin-left: 0;
            }
            to {
                margin-left: -200%;
            }
        }

        ul li:nth-child(3) {
            background-image: url(images/carousel/cloud_three.png);
            animation: three 20s linear infinite alternate;
        }
        @keyframes three {
            from {
                margin-left: 0;
            }
            to {
                margin-left: -300%;
            }
        }
    </style>
</head>

<body>
    <ul>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</body>

</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值