Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    How to make Awesome Radar Animation using HTML & CSS

    8 May 2025

    How to create Cross Road Game using HTML CSS and JS

    2 May 2025

    How to create 3D Animated Bee website using HTML CSS and JS

    28 April 2025
    Facebook X (Twitter) Instagram YouTube Telegram Threads
    Coding StellaCoding Stella
    • Home
    • Blog
    • HTML & CSS
      • Login Form
    • JavaScript
    • Hire us!
    Coding StellaCoding Stella
    Home - JavaScript - How to make a New 9 Dot Navigation Menu in HTML CSS & JavaScript
    JavaScript

    How to make a New 9 Dot Navigation Menu in HTML CSS & JavaScript

    Coding StellaBy Coding Stella12 January 2024Updated:12 January 20241 Comment4 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Email WhatsApp Copy Link

    If you’re looking to add a touch of modern simplicity to your website’s navigation, this quick guide is for you! We’ll walk through the process of creating or updating a 9 Dot Navigation Menu using HTML, CSS, and a dash of JavaScript. Check Old Version of 9 Dot Navigation Menu.

    In this straightforward tutorial, we’ll cover the essential steps to build a clean and stylish 9 Dot Navigation Menu. This menu style, popularized by many modern web applications, provides a visually appealing and user-friendly navigation experience.

    No need to worry if you’re just starting out – this guide is beginner-friendly. We’ll explore the basic HTML structure for your menu, style it with CSS to achieve a sleek look, and introduce a bit of JavaScript for that extra touch of interactivity.

    By the end of this tutorial, you’ll have a practical and stylish 9 Dot Navigation Menu that’s ready to enhance the navigation experience for your website visitors. Let’s dive in and give your site a modern twist with this simple yet effective navigation solution.

    HTML :

    The provided code is an HTML document that represents a new 9-dot navigation menu. It consists of a container with nine icons, each represented by a <span> element. The icons are from the Ionicons library and include camera, diamond, chat bubble, alarm, game controller, moon, notifications, water, and time. The menu has a visually appealing design and can be used for navigation purposes on a website or application.

    <!DOCTYPE html>
    <html lang="en" >
    <head>
      <meta charset="UTF-8">
      <title>New 9 Dot Navigation Menu | CodingStella</title>
      <link rel="stylesheet" href="./style.css">
    
    </head>
    <body>
    <!-- partial:index.partial.html -->
    <div class="navigation">
      <span style="--i:0;--x:-1;--y:0;">
        <ion-icon name="camera-outline"></ion-icon>
      </span>
      <span style="--i:1;--x:1;--y:0;">
        <ion-icon name="diamond-outline"></ion-icon>
      </span>
      <span style="--i:2;--x:0;--y:-1;">
        <ion-icon name="chatbubble-outline"></ion-icon>
      </span>
      <span style="--i:3;--x:0;--y:1;">
        <ion-icon name="alarm-outline"></ion-icon>
      </span>
      <span style="--i:4;--x:1;--y:1;">
        <ion-icon name="game-controller-outline"></ion-icon>
      </span>
      <span style="--i:5;--x:-1;--y:-1;">
        <ion-icon name="moon-outline"></ion-icon>
      </span>
      <span style="--i:6;--x:0;--y:0;">
        <ion-icon name="notifications-outline"></ion-icon>
      </span>
      <span style="--i:7;--x:-1;--y:1;">
        <ion-icon name="water-outline"></ion-icon>
      </span>
      <span style="--i:8;--x:1;--y:-1;">
        <ion-icon name="time-outline"></ion-icon>
      </span>
    </div>
    <!-- partial -->
      <script src='https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js'></script>
    <script src='https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js'></script><script  src="./script.js"></script>
    
    </body>
    </html>
    

    CSS :

    The provided CSS code styles a 9-dot navigation menu. It sets the overall layout of the page, centers it vertically and horizontally, and applies a dark background color. The navigation menu itself is a square container that transitions in size when clicked. Each dot within the container is represented by a <span> element and transitions in size and position when the menu is active. The dots contain icons from the Ionicons library, which also transition in size and color when the menu is active or hovered over.

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    body {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background: #262433;
    }
    
    .navigation {
      position: relative;
      width: 70px;
      height: 70px;
      background: #171b21;
      border-radius: 10px;
      cursor: pointer;
      display: flex;
      justify-content: center;
      align-items: center;
      transition: 0.5s;
      transition-delay: 0.8s;
    }
    .navigation.active {
      width: 200px;
      height: 200px;
      transition-delay: 0s;
    }
    
    .navigation span {
      position: absolute;
      width: 7px;
      height: 7px;
      display: flex;
      justify-content: center;
      align-items: center;
      background: #fff;
      border-radius: 50%;
      transform: translate(calc(12px * var(--x)), calc(12px * var(--y)));
      transition: transform 0.5s, width 0.5s, height 0.5s, background 0.5s;
      transition-delay: calc(0.1s * var(--i));
    }
    .navigation.active span {
      width: 45px;
      height: 45px;
      background: #333849;
      transform: translate(calc(60px * var(--x)), calc(60px * var(--y)));
    }
    
    .navigation span ion-icon {
      transition: 0.5s;
      font-size: 0em;
    }
    
    .navigation.active span ion-icon {
      font-size: 1.35em;
      color: #fff;
    }
    .navigation.active span:hover ion-icon {
      color: #2dfc52;
      filter: drop-shadow(0 0 2px #2dfc52) drop-shadow(0 0 5px #2dfc52)
        drop-shadow(0 0 15px #2dfc52);
    }

    JavaScript:

    The provided JavaScript code adds an event listener to the .navigation element. When the element is clicked, it toggles the active class on the element, which triggers a transition effect. This is achieved by using the classList.toggle() method to add or remove the active class on the .navigation element. The code utilizes CSS transitions and transforms to animate the size and position of the child span elements within the .navigation container.

    const navigation = document.querySelector(".navigation");
    
    navigation.addEventListener("click", () => {
      navigation.classList.toggle("active");
    });

    In summary, you’ve successfully created a New/Updated 9 Dot Navigation Menu for your website using HTML, CSS, and a bit of JavaScript. This simple and beginner-friendly guide has empowered you to enhance your site’s aesthetics and improve user navigation.

    If your project encounters any bumps in the road, don’t be discouraged. The source code is within reach. Just click Download to start your coding adventure. Happy coding!

    magic navigation menu navigation menu
    Share. Copy Link Twitter Facebook LinkedIn Email WhatsApp
    Previous ArticleHow to make Hand Scanning Animation using HTML & CSS
    Next Article How to make 9 Dot Navigation Menu in HTML CSS & JavaScript
    Coding Stella
    • Website

    Related Posts

    JavaScript

    How to create Cross Road Game using HTML CSS and JS

    2 May 2025
    JavaScript

    How to create 3D Animated Bee website using HTML CSS and JS

    28 April 2025
    JavaScript

    How to create Animated File Upload Modal using JavaScript

    23 April 2025
    View 1 Comment

    1 Comment

    1. Pingback: How to make a 9 Dot Navigation Menu in HTML CSS & JavaScript | Coding Stella

    Leave A Reply Cancel Reply

    Trending Post

    Master Frontend in 100 Days Ebook

    2 March 202419K Views

    How to make Modern Login Form using HTML & CSS | Glassmorphism

    11 January 202416K Views

    How to make I love you Animation in HTML CSS & JavaScript

    14 February 202414K Views

    How to make Valentine’s Day Card using HTML & CSS

    13 February 202412K Views
    Follow Us
    • Instagram
    • Facebook
    • YouTube
    • Twitter
    ads
    Featured Post

    How to make Modern Login Form using HTML & CSS | Glassmorphism

    11 January 2024

    How to make Flex Card Slider on Hover in HTML CSS & JavaScript

    12 January 2024

    How to Make A Quiz Application with a Timer using HTML CSS and JavaScript

    14 December 2023

    How to make Ball Leaping Loader using HTML & CSS

    21 February 2024
    Latest Post

    How to make Awesome Radar Animation using HTML & CSS

    8 May 2025

    How to create Cross Road Game using HTML CSS and JS

    2 May 2025

    How to create 3D Animated Bee website using HTML CSS and JS

    28 April 2025

    How to create Animated File Upload Modal using JavaScript

    23 April 2025
    Facebook X (Twitter) Instagram YouTube
    • About Us
    • Privacy Policy
    • Return and Refund Policy
    • Terms and Conditions
    • Contact Us
    • Buy me a coffee
    © 2025 Coding Stella. Made with 💙 by @coding.stella

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Looks like you're using an ad blocker. We rely on advertising to help fund our site.
    Okay! I understood