Tue Oct 18 2022

Link Filling with Box-shadow

CSS3893 views

File Name: link-filling-with-box-shadow.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>Link Filling with Box-shadow on Hover</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Russo+One&display=swap" rel="stylesheet"> 
    <style>
        * {
            padding: 0;
            margin: 0;
            font-family: 'Russo One', sans-serif;
        }

        body {
            background-color: #292929;
        }

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

        a {
            color: #fff;
            font-size: 35px;
            letter-spacing: 2px;
            text-decoration: none;
            box-shadow: inset 0 0 0 0 #fff;
            transition: color 0.3s linear,
                        box-shadow 0.3s ease-in-out;
        }

        a:hover {
            color: #292929;
            box-shadow: inset 250px 0 0 0 #fff;
        }
    </style>
</head>
<body>
    <section>
        <a href="">Hover This</a>
    </section>
</body>
</html>

Result Screenshot(s)

Link Filling with Box-shadowWorking 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.