Hover with Transition and moving gradient Effect

Hover with Transition and moving gradient Effect 

HTML CODE

<!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">
    <link rel="stylesheet" href="try.css">
    <title>Document</title>
</head>
<body>
    <header> <a href="https://google.com">Click Me</a></header>
</body>
</html>


CSS CODE

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap');
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html{
    font-size: 62.5%;
}

body{
    font-family: 'Montserrat', sans-serif;
}

header{
    height: 100vh;
    background-image: linear-gradient(120deg,#F2059F,#04B2D9,#04D94F,#F2CB05,#F28705);
    background-size: 300%;
    animation: madan 5s infinite;
}

@keyframes madan{
    0%{
        background-position: 0% 0%;
    }

    25%{
        background-position: 50% 0%;
    }

    50%{
        background-position: 100% 0%;
    }

    75%{
        background-position: 50% 0%;
    }

    100%{
        background-position: 0% 0%;
    }

}

a{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    padding: 1rem;
    border: 2px solid white;
    text-decoration: none;
    color: white;
    font-size: 3rem;
    transition: all 0.5s;
}

a:hover{
    background: rgb(245, 95, 95);
    font-size: 5rem;
}

Comments

Popular posts from this blog

CSS simple grid layout

Gsap timeline position parameters

GSAP Timelines