navigation tab image

How to Create Bottom Tab Navigation Using HTML, CSS & JavaScript (Step-by-Step Guide)

the-web-decode
Written by The Web Decode

November 25, 2025

If you’re a beginner in frontend development and still confuse which project to build, don’t worry. In this post we’ll learn how to create a bottom tab navigation using HTML, CSS, and JavaScript. It’s a simple, mobile-friendly design when you click an icon it becomes highlighted while the others turn gray.

I’ll use only a few lines of plain JavaScript so it’s easy to understand. No delays — let’s build a responsive bottom tab navigation step by step without any unnecessary stuff.

Learn the structure of the files

  • Create an index.html file and add the main tab navigation structure inside it.
  • Make a style.css file where you will design all your navigation tabs.
  • Create an index.js file and write a small function that highlights the icon when you click it.

To add icons, use Remix Icons. Pick any icon you like and add the CDN link inside the <head> tag.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/remixicon/4.6.0/remixicon.css" integrity="sha512-kJlvECunwXftkPwyvHbclArO8wszgBGisiLeuDFwNM8ws+wKIw0sv1os3ClWZOcrEB2eRXULYUsm8OVRGJKwGA==" crossorigin="anonymous" referrerpolicy="no-referrer" />

HTML Structure

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Bottom Tab Navigation using HTML, CSS and JavaScript</title>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/remixicon/4.6.0/remixicon.css"/>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="navigation">
        <ul>
            <li class="list active">
                <a href="#">
                    <span class="icon">
                        <i class="ri-home-9-line"></i>
                    </span>
                    <span class="text">Home</span>
                </a>
            </li>
            <li class="list">
                <a href="#">
                    <span class="icon">
                        <i class="ri-search-line"></i>
                    </span>
                    <span class="text">Search</span>
                </a>
            </li>
            <li class="list">
                <a href="#">
                    <span class="icon">
                        <i class="ri-notification-3-line"></i>
                    </span>
                    <span class="text">Informe</span>
                </a>
            </li>
            <li class="list">
                <a href="#">
                    <span class="icon">
                        <i class="ri-settings-5-line"></i>
                    </span>
                    <span class="text">Setting</span>
                </a>
            </li>
            <li class="list">
                <a href="#">
                    <span class="icon">
                        <i class="ri-user-6-line"></i>
                    </span>
                    <span class="text">User</span>
                </a>
            </li>
            <div class="indicator"></div>
        </ul>
    </div>
    <script src="index.js"></script>
</body>
</html>

CSS Structure

*{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Poppins", sans-serif;
        }
        body{
            min-height: 100vh;
            width: 100%;
            background: #101010;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .navigation{
            width: 450px;
            height: 80px;
            position: relative;
            border-radius: 5px;
            background: #e4e5e7;
            display: flex;
            justify-content: center;
        }
        .navigation ul{
            position: relative;
            display: flex;
            width: 400px;
        }
        .navigation ul li{
            position: relative;
            list-style: none;
            width: 80px;
            height: 80px;
        }
        .navigation ul li a{
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            width: 100%;
            text-align: center;
            font-weight: 500;
            text-decoration: none;
        }
        .navigation ul li a .icon{
            position: relative;
            display: block;
            line-height: 85px;
            font-size: 1.5em;
            transition: 0.3s;
            text-align: center;
            color: #5f5f5f;
        }
        .navigation ul li a:hover .icon{
            color: #101010;
        }
        .navigation ul li.active a .icon{
            color: #0d5aff;
            transform: translateY(-8px);
        }
        .navigation ul li a .text{
            position: absolute;
            font-weight: 600;
            color: #fff;
            font-size: 0.6em;
            text-transform: uppercase;
            transform: translateY(0);
            letter-spacing: 0.05em;
            opacity: 0 ;
        }
        .navigation ul li.active a .text{
            opacity: 1;
            transform: translateY(16px);
            z-index: 10;
        }
        .indicator{
            position: absolute;
            width: 80px;
            height: 80px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            transition: 0.5s;
        }
        .indicator::before{
            content: '';
            position: absolute;
            bottom: 14px;
            width: 80%;
            height: 16px;
            background: #0d5aff;
            border-radius: 5px;
        }
        .navigation ul li:nth-child(2).active ~ .indicator{
            transform: translateX(calc(80px * 1));
        }
        .navigation ul li:nth-child(3).active ~ .indicator{
            transform: translateX(calc(80px * 2));
        }
        .navigation ul li:nth-child(4).active ~ .indicator{
            transform: translateX(calc(80px * 3));
        }
        .navigation ul li:nth-child(5).active ~ .indicator{
            transform: translateX(calc(80px * 4));
        }

JavaScript Structure

let list = document.querySelectorAll(".list")
        function activeLink(){
            list.forEach((item) => 
            item.classList.remove('active'));
            this.classList.add('active');
        }
        list.forEach((item) => item.addEventListener('click', activeLink));

the-web-decode

The Web Decode is a platform where you can learn custom coding. Here you will get to learn some website features like buttons, image sliders, navigation, hero sections and many more.

Leave a Comment