学无先后,达者为师

网站首页 编程语言 正文

css 水波纹效果

作者:沉、睡 更新时间: 2022-02-02 编程语言

css 水波纹效果

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>水波纹效果</title>
</head>
<body>
    <div class="wave">
        水波纹效果
        <div class="wave1" style="top: 50%;"></div>
        <div class="wave2" style="top: 50%;"></div>
        <div class="wave3" style="top: 50%;"></div>
    </div>
    <style>

.wave{
            position: relative;
            border: 1px solid silver;
            width: 100px;
            height: 100px;
            border-radius: 50%;
            line-height: 50px;
            margin: 0 auto;
            font-size: 14px;
            text-align: center;
            overflow: hidden;
            animation: water-wave linear infinite;
        }
        .wave1{
            position: absolute;
            top: 40%;
            left: -25%;
            background: #33cfff;
            opacity: .7;
            width: 200%;
            height: 200%;
            border-radius: 40%;
            animation: inherit;
            animation-duration: 10s;
        }
        .wave2{
            position: absolute;
            top: 40%;
            left: -35%;
            background: #0eaffe;
            opacity: .7;
            width: 200%;
            height: 200%;
            border-radius: 35%;
            animation: inherit;
            animation-duration: 14s;
        }
        .wave3{
            position: absolute;
            top: 50%;
            left: -35%;
            background: #0f7ea4;
            opacity: .3;
            width: 200%;
            height: 200%;
            border-radius: 33%;
            animation: inherit;
            animation-duration: 22s;
        }
        @keyframes  water-wave{
            0% {transform: rotate(0deg);}
            100% {transform: rotate(360deg);}
        }

    </style>
</body>
</html>

原文链接:https://blog.csdn.net/zz975896590/article/details/119991126

栏目分类
最近更新