Sat Apr 22 2023

Gradient Border Animtion

CSS132 views

File Name: gradient-border-animation.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>Button Border Effect</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        body {
            background-color: #282828;
        }

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

        section a {
            font-size: 18px;
            padding: 10px 25px;
            background-color: #0e1538;
            text-decoration: none;
            position: relative;
            color: #fbff00;
            transition: 0.3s all ease-in-out;
            margin-top: 50px;
            
        }

        section a:hover {
            color: #d4002e;
        }

        section a::before {
            content: '';
            position: absolute;
            top: -4px;
            left: -4px;
            right: -4px;
            bottom: -4px;
            background: linear-gradient(310deg, #fbff00, #0e1538, #d4002e);
            z-index: -1;
            transition: 0.3s all ease-in-out;
        }

        section a:hover::before {
            transform: skewX(2deg) skewY(4deg);
        }

        section a::after {
            content: '';
            position: absolute;
            top: -4px;
            left: -4px;
            right: -4px;
            bottom: -4px;
            background: linear-gradient(310deg, #fbff00, #0e1538, #d4002e);
            z-index: -1;
            transition: 0.3s all ease-in-out;
            filter: blur(10px);
        }
    </style>
</head>
<body>
    <section>
        <a href="">Hover Me</a>
    </section>
</body>
</html>

Result Screenshot(s)

Gradient Border AnimtionWorking 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.