html+css制作运动气泡小动画

文章展示了一个使用HTML和CSS创建的动态气泡效果。通过CSS的径向渐变背景、动画关键帧以及角度旋转,实现了不同颜色的气泡上下浮动,营造出视觉动感。
摘要由CSDN通过智能技术生成

以上是效果静态图(代码在下面)

 

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>运动气泡</title>
        <style type="text/css">
            body{
                background-color: aquamarine;
                overflow: hidden;
            }
            ul{
                list-style: none;
                display: flex;
            }
            li{
                width: 100px;
                height: 100px;
                border-radius: 50%;
                background-image: radial-gradient(rgba(255,255,255,0.3)55% ,rgba(255,255,255,0.8) 80%);
                margin: 400px 100px;
                
            }
            ul li:nth-child(1){
                background-color: #ADFF2F;
                animation:name 3s 0.5s linear infinite;
            }
            ul li:nth-child(2){
                background-color: azure;
                animation:name 3s 0.7s linear infinite;
            }
            ul li:nth-child(3){
                background-color: bisque;
                animation:name 3s 0.9s linear infinite;
            }
            ul li:nth-child(4){
                background-color: chocolate;
                animation:name 3s 1.1s linear infinite;
            }
            ul li:nth-child(5){
                background-color: chartreuse;
                animation:name 3s 1.3s linear infinite;
            }
            ul li:nth-child(6){
                animation:name 3s 1.5s linear infinite;
            }
            
            @keyframes name{
                0%{
                    transform: translateY(0px);
                }
                50%{
                    transform: translateY(500px);
                }
                75%{
                    transform: translateY(-250px);
                }
                100%{
                    transform: translateY(0px);
                }
            }
            li::after{
                width: 33%;
                height: 33%;
                border: 3px solid greenyellow;
                border-radius: 50%;
                border-color: rgba(255,255,255,0.8) transparent transparent;
                transform: rotate(45deg);/* 角度旋转 */
                position: absolute;
                top:20%;
                right: 25%;
            }
            
        </style>
    </head>
    
    <body>
        <ul>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </body>

</html>

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值