Devnote

Web Development Blog Company, Services India

PHP cURL error 60: SSL certificate problem - Windows & Linux Fix
PHP cURL error 60: SSL certificate problem – Windows & Linux Fix
February 11, 2026
Fix localhost refused to connect After Installing XAMPP / WAMP
Fix “localhost refused to connect” After Installing XAMPP / WAMP
February 9, 2026
Composer Error Memory exhausted When Installing Packages - Real Fix
Composer Error: Memory exhausted When Installing Packages – Real Fix
February 6, 2026
MySQL 8 Error Unknown collation: utf8mb4_0900_ai_ci - Safe Migration Guide
MySQL 8 Error Unknown collation: utf8mb4_0900_ai_ci – Safe Migration Guide
February 4, 2026
WordPress Critical Error When Editing with Gutenberg - Root Cause + Fix
WordPress Critical Error When Editing with Gutenberg – Root Cause + Fix
February 2, 2026
Devnote

Type and hit Enter to search

  • Home
  • Laravel
    • Auth
    • Migration
    • DATATABLE
    • Yajra
  • wordpress
    • plugin
    • WPBakery
    • woocommerce
  • PHP
    • MYSQL
    • Ajax
  • Blog
  • Informational
    • About us
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
  • Contact US
Devnote
  • Home
  • Laravel
    • Auth
    • Migration
    • DATATABLE
    • Yajra
  • wordpress
    • plugin
    • WPBakery
    • woocommerce
  • PHP
    • MYSQL
    • Ajax
  • Blog
  • Informational
    • About us
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
  • Contact US
Magic Navigation Menu using HTML CSS and Javascript

Magic Navigation Menu using HTML CSS and Javascript

Image
Devnote team
September 29, 2023
3
1.5K Views
0 Comments

Today, In this tutorial, I will explain How to create a Magic Navigation Menu using HTML CSS, and Javascript with examples. I will give you an example of How to create a magic navigation menu indicator using HTML, CSS, and Javascript with example.

Magic Navigation Menu using HTML CSS and Javascript

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>Magic Navigation Menu using HTML CSS and Javascript</title>
    <link rel="stylesheet" href="styles.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>

<body> 
    <div class="navigation">
        <ul>
            <li class="list active">
                <a href="#">
                    <span class="icon">
                        <i class="fa fa-home"></i>
                    </span>
                    <span class="text">Home</span>
                    <span class="circle"></span>
                </a>
            </li>
            <li class="list">
                <a href="#">
                    <span class="icon">
                        <i class="fa fa-user-o"></i>
                    </span>
                    <span class="text">Contact</span>
                    <span class="circle"></span>
                </a>
            </li>
            <li class="list">
                <a href="#">
                    <span class="icon">
                        <i class="fa fa-comment-o"></i>
                    </span>
                    <span class="text">Chat</span>
                    <span class="circle"></span>
                </a>
            </li>
            <li class="list">
                <a href="#">
                    <span class="icon">
                        <i class="fa fa-camera"></i>
                    </span>
                    <span class="text">Gallery</span>
                    <span class="circle"></span>
                </a>
            </li>
            <li class="list">
                <a href="#">
                    <span class="icon">
                        <i class="fa fa-cog"></i>
                    </span>
                    <span class="text">Customize</span>
                    <span class="circle"></span>
                </a>
            </li>
            <div class="selected"></div>
        </ul>
    </div>

    <script src="scripts.js"></script>
</body>
 
</html>
styles.css
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,900;1,700&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}
 
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #06021b;
}
 
.navigation {
    position: relative;
    width: 440px;
    height: 70px;
    background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}
 
.navigation ul {
    display: flex;
    width: 350px;
}
 
.navigation ul li {
    position: relative;
    width: 70px;
    height: 70px;
    list-style: none;
    z-index: 1;
}
 
.navigation ul li a {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    text-align: center;
}
 
.navigation ul li a .icon {
    position: relative;
    display: block;
    line-height: 75px;
    font-size: 24px;
    text-align: center;
    color: #fff;
    transition: 0.4s;
}
 
.navigation ul li.active a .icon {
    transform: translateY(-36px);
}
 
.navigation ul li a .text {
    position: absolute;
    color: #fff;
    font-size: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.4s;
}
 
.navigation ul li.active a .text {
    opacity: 1;
    transform: translateY(10px);
}
 
.navigation ul li a .circle {
    position: absolute;
    display: block;
    width: 50px;
    height: 50px;
    background: transparent;
    border-radius: 50%;
    border: 1.8px solid #fff;
    transform: translateY(-37px) scale(0);
}
 
.navigation ul li.active a .circle {
    transition: 0.4s;
    transition-delay: 0.4s;
    transform: translateY(-37px) scale(1);
}
 
.selected {
    position: absolute;
    top: -50%;
    width: 70px;
    height: 70px;
    background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
    border: 6px solid #06021b;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: .5s;
}
 
.selected::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -22px;
    width: 20px;
    height: 20px;
    background: transparent;
    border-top-right-radius: 20px;
    box-shadow: 1px -10px 0 #06021b;
}
 
.selected::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -22px;
    width: 20px;
    height: 20px;
    background: transparent;
    border-top-left-radius: 20px;
    box-shadow: -1px -10px 0 #06021b;
}
 
.navigation ul li:nth-child(1).active~.selected {
    transform: translateX(calc(70px * 0));
}
 
.navigation ul li:nth-child(2).active~.selected {
    transform: translateX(calc(70px * 1));
}
 
.navigation ul li:nth-child(3).active~.selected {
    transform: translateX(calc(70px * 2));
}
 
.navigation ul li:nth-child(4).active~.selected {
    transform: translateX(calc(70px * 3));
}
 
.navigation ul li:nth-child(5).active~.selected {
    transform: translateX(calc(70px * 4));
}

.color-white {
    color: #FFF;
}
scripts.js
const listClass = document.querySelectorAll('.list');
 
function activeLink() {
    listClass.forEach((value) =>
    value.classList.remove('active'));
    this.classList.add('active');
}
 
listClass.forEach(
    (value) => value.addEventListener('click', activeLink)
);
Output:
Magic Navigation Menu using HTML CSS and Javascript Output
Magic Navigation Menu using HTML CSS and Javascript Output

Categories:

CSSHTMLjavascriptjQuery

Other Articles

Laravel Array Length Validation
Previous

Laravel Array Length Validation

How to Get Query Execution Time in Laravel
Next

How to Get Query Execution Time in Laravel?

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

jQuery Validate Not Working After AJAX Loaded Form – Common Mistakes and Fix

jQuery Validate Not Working After AJAX Loaded Form – Common Mistakes and Fix

December 31, 2025
Jquery Validate Rules With if Condition

Jquery Validate Rules With if Condition

July 29, 2025
The Rise of ES2025: What's New in JavaScript?

The Rise of ES2025: What’s New in JavaScript?

January 24, 2025
HTML Marquee tag

How to use HTML Marquee tag

January 23, 2025
Devnote

Devnote provides a collection of tutorials about PHP, Laravel, WordPress, Django, MySQL, Bootstrap, Jquery, Ajax, APIs, CRUD operations, etc.

Devnote © , All Rights Reserved.

Page Links

  • Home
  • About us
  • Blog
  • Contact US
  • Site map

Category

  • PHP
  • Laravel
  • wordpress
  • HTML
  • jQuery

Follow Us

Facebook Instagram Twitter Youtube Linkedin Pinterest
Morbi, Gujarat, India - 363641
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT
Advertisement