Cookies Consent

This website uses cookies to ensure you get the best experience on our website.

Learn More

css hover filling effect

css hover filling effect, css filling effect, css animation, css tutorial, simple css project, css filling animation blog, aathil ducky, aathilducky
1 min read

 css hover 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">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>

<body>
    <div class="container">
        <ul>
            <li class="list">Home</li>
            <li class="list">About</li>
            <li class="list">Contects</li>
            <li class="list">Services</li>
        </ul>
    </div>
</body>

</html>



CSS


* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

body {
    display: flex;
    justify-content: center;
}

.container {
    margin-top: 10vh;
}

.container ul {
    list-style-type: none;
}

.container ul li {
    display: block;
    font-size: 40px;
    margin: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40vh;
    height: 15vh;
    border: 3px solid lightgray;
    border-radius: 10px;
    position: relative;
}

.list::before {
    content: '';
    position: absolute;
    background-color: deeppink;
    z-index: -1;
    width: 100%;
    height: 100%;
    transition: 0.5s;
    transform-origin: 0 0;
    transition-timing-function: ease-in-out;
    border-radius: 10px;
}

.list::before {
    transform: scaleX(0);
}

.list:hover::before {
    transform: scaleX(1);
}


here

Labels : #css ,#works ,

Post a Comment