Mon Aug 22 2022

Button with Liquid Filling Effect

CSS5158 views

File Name: button-with-liquid-filling-effect.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Liquid Filling Effect on Button</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            font-family: 'Poppins', sans-serif;
        }

        body { background-color: #292929; }

        section {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100vh;
        }

        .btn {
            position: relative;
            padding: 10px 50px;
            border-radius: 30px;
            text-decoration: none;
            color: #292929;
            background-color: #ff081e;
            font-weight: bold;
            text-transform: uppercase;
            transition: 1s all ease-in-out;
            overflow: hidden;
        }

        .btn::before {
            position: absolute;
            content: '';
            width: 400px;
            height: 400px;
            background-color: #ececec;
            top: -370px;
            left: -120px;
            border-radius: 45%;
            transition: 2s all ease-in-out;
            animation: wave 10s infinite linear;
        }

        .btn::after {
            position: absolute;
            content: '';
            width: 400px;
            height: 400px;
            background-color: #ececec80;
            top: -360px;
            left: -125px;
            border-radius: 45%;
            transition: 2s all ease-in-out;
            animation: wave 9s infinite linear;
        }

        .btn span {
            position: relative;
            z-index: 1;
        }

        .btn:hover {
            color: #fff;
        }

        .btn:hover::before {
            top: -450px;
        }

        .btn:hover::after {
            top: -440px;
        }

        @keyframes wave {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
            
        }
        
    </style>
</head>
<body>
    <section>
        <a href="" class="btn">
            <span>
                Subscribe!
            </span>
        </a>
    </section>
</body>
</html>

Result Screenshot(s)

Button with Liquid Filling EffectWorking Sample0

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.