Horje
Create A Bottom Navigation Menu using HTML and CSS

This article will show you how to create a bottom navigation menu using HTML and CSS. The navigation menu is an essential component in modern web design. It allows users to navigate through a website easily.

Here, we use HTML to create the structure of the Bottom Navigation menu, and CSS add styles to the elements.

Example 1: In this example, we will create a simple responsive bottom navigation menu.

HTML

<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content=
        "width=device-width, initial-scale=1.0">
  
    <title>
        Bottom Navigation with HTML and CSS
    </title>
  
    <link rel="stylesheet" href=
  
    <style>
        body {
            margin: 0;
            font-family: 'Arial', sans-serif;
        }
  
        .container {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }
  
        .bottom-nav {
            background-color: #4b8b01;
            display: flex;
            justify-content: space-around;
            align-items: center;
            position: fixed;
            bottom: 0;
            width: 100%;
        }
  
        .bottom-nav a {
            color: #fff;
            text-align: center;
            padding: 14px 16px;
            text-decoration: none;
            font-size: 17px;
        }
  
        .bottom-nav a:hover {
            background-color: #2a93d5;
        }
  
        @media screen and (max-width: 600px) {
            .bottom-nav {
                flex-direction: column;
                align-items: stretch;
            }
  
            .bottom-nav a {
                flex: 1;
            }
        }
    </style>
</head>
  
<body>
    <div class="container">
        <nav class="bottom-nav">
            <a href="#home">Home</a>
            <a href="#courses">Courses</a>
            <a href="#jobs">Jobs</a>
            <a href="#news">News</a>
            <a href="#contact">Contact</a>
            <a href="#about">About</a>
        </nav>
    </div>
</body>
  
</html>

Output:

botton-nav-2

Example 2: In this example, we will create a bottom navigation menu with icons.

HTML

<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content=
        "width=device-width, initial-scale=1.0">
      
    <title>
        Bottom Navigation with Icons
    </title>
      
    <link rel="stylesheet" href=
  
    <style>
        body {
            margin: 0;
            font-family: 'Arial', sans-serif;
        }
  
        .container {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }
  
        .bottom-nav {
            background-color: #4b8b01;
            display: flex;
            justify-content: space-around;
            align-items: center;
            position: fixed;
            bottom: 0;
            width: 100%;
        }
  
        .bottom-nav a {
            color: #fff;
            text-align: center;
            padding: 14px 16px;
            text-decoration: none;
            font-size: 17px;
        }
  
        .bottom-nav a:hover {
            background-color: #2a93d5;
        }
  
        .bottom-nav a .icon {
            margin-right: 8px;
        }
    </style>
</head>
  
<body>
    <div class="container">
        <nav class="bottom-nav">
            <a href="#home">
                <i class="fas fa-home icon"></i>Home
            </a>
            <a href="#courses">
                <i class="fas fa-graduation-cap icon"></i>Courses
            </a>
            <a href="#jobs">
                <i class="fas fa-briefcase icon"></i>Jobs
            </a>
            <a href="#news">
                <i class="fas fa-newspaper icon"></i>News
            </a>
            <a href="#contact">
                <i class="fas fa-envelope icon"></i>Contact
            </a>
            <a href="#about">
                <i class="fas fa-info-circle icon"></i>About
            </a>
        </nav>
    </div>
</body>
  
</html>

Output:

botton-nav




Reffered: https://www.geeksforgeeks.org


Geeks Premier League

Related
How to Create Avatar Images using HTML and CSS ? How to Create Avatar Images using HTML and CSS ?
Create a Coupon using HTML and CSS Create a Coupon using HTML and CSS
KBC Game in C++ KBC Game in C++
How To Remove Comments In Google Docs How To Remove Comments In Google Docs
How to Create Survey in Google Forms (8 Easy Steps) How to Create Survey in Google Forms (8 Easy Steps)

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
11