Tue Aug 30 2022

Animated Vertical Menu

CSS4191 views

File Name: animated-vertical-menu.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>Animated Vertical Menu</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            font-family: 'Prompt', sans-serif;
        }

        body { background-color: #2A3950; }

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

        ul {
            list-style: none;
            width: 250px;
        }

        ul li {
            width: 100%;
            margin: 3px 0;
            border-radius: 5px;
            transition: 0.3s all ease;
            background: linear-gradient(135deg, #fe9677, #f64668);
        }

        ul li a {
            display: block;
            padding: 8px;
            text-decoration: none;
            font-size: 18px;
            color: #fff;
            overflow: hidden;
            white-space: nowrap;
            text-align: left;
            letter-spacing: 1px;
        }

        ul li:hover {
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
            transform: scale(1.2);
        }

        ul li:hover a {
            text-align: right;
            animation: textAni 0.3s linear;
        }

        @keyframes textAni {
            0%, 100% {
                opacity: 1;
                letter-spacing: 1px;
            }

            50% {
                opacity: 1;
                letter-spacing: 100px;
            }
        }
    </style>
</head>
<body>
    <section>
        <ul>
            <li><a href="">Home</a></li>
            <li><a href="">About Us</a></li>
            <li><a href="">Gallery</a></li>
            <li><a href="">Blog</a></li>
            <li><a href="">Contact Us</a></li>
        </ul>
    </section>
</body>
</html>

Result Screenshot(s)

Animated Vertical MenuWorking 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.