Mobile Navigation using HTML CSS

Hello fellow developers !!!

Welcome to an exciting journey of creating a stunning Mobile Navigation using the dynamic duo of HTML and CSS!

By the end of this post, you'll have a sleek and responsive navigation bar that will elevate the user experience on your website.

Feel free to adjust the text further to suit your preferences!!!

Preview


HTML Code Structure :-

index.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> Mobile Navigation </title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="main-container">
        <nav class="navigation">
            <ul>
                <li><i class="fa-solid fa-house"></i></li>
                <li><i class="fa-solid fa-user"></i></li>
                <li><i class="fa-solid fa-rocket"></i></li>
                <li><i class="fa-solid fa-people-group"></i></li>
                <li><i class="fa-solid fa-cart-shopping"></i></li>
            </ul>
        </nav>
    </div>
</body>
</html>

CSS Code Structure :-

style.css

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

.navigation {
    bottom: 2rem;
    position: absolute;
    left: 50%;
    display: block;
    margin: 0 auto;
    border-radius: 1.5rem;
    transform: translate(-50%, 0);
    background-color: #232F34;
}

.navigation ul {
    list-style: none;
    display: flex;
    justify-content: space-around;
}

.navigation ul li {
    height: 35px;
    width: 35px;
    margin: 1rem;
    color: white;
    padding: 0 1rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s linear;
}

.navigation ul li:hover {
    color: #344955;
    transform: scale(1.2);
    background-color: #fff;
}

.navigation ul li:hover i {
    border-radius: 50%;
}

Join Now


Previous Year Questions Now to Boost Your Exam Performance

LOADS OF LOGIC