How to create CSS hoverable side navigation menu

How to create CSS hoverable side navigation menu

In this guide, I will explain how to create a vertical side menu using Bootstrap, and CSS and optionally Javascript. Even if you are a beginner, you will be able to implement this and create a hoverable vertical navigation menu with ease.

In this guide, I will explain how to create a vertical side menu using Bootstrap, and CSS and optionally Javascript. Even if you are a beginner, you will be able to implement this and create a hoverable vertical navigation menu with ease.

There are multiple ways to implement hoverable vertical menu though it depends on some factors.

  1. Is the number of sub-items under each menu item equal?
  2. Do you want to use Only css or can use jquery plugin too?

Don't worry if this questions confuse you. Later, when you will see the different examples, you will understand the meaning of these questions.

Method #1– Create Vertical Side Hoverable menu with equal number of sub-items using only CSS

This is the most flexible vertical menu with great user experience though one downside is, you can only keep equal number of sub-items under each menu item which is not usual case generally.

Step 1 – HTML Markup

At first, we will create a basic structure of our vertical menu with 3 menu items and 3-3 sub-items in each menu items.

Note that, here I am using fontawesome too but you are not required to use it. If you do want to use fontawesome icons then don't forget to add font-awesome.css file in header.

<nav>
    <div class="menu-item">
      <h4><a href="#"><i class='fa fa-gear'></i> Settings</a></h4>
      <ul>
        <li><a href="#">Account</a></li>
        <li><a href="#">Profile</a></li>
        <li><a href="#">Security</a></li>
      </ul>
    </div>

    <div class="menu-item">
      <h4><a href="#"><i class='fa fa-question-circle'></i> Help</a></h4>
      <ul>
        <li><a href="#">FAQ</a></li>
        <li><a href="#">Submit a ticket</a></li>
        <li><a href="#">Network Status</a></li>
      </ul>
    </div>

    <div class="menu-item">
      <h4><a href="#"><i class='fa fa-envelope'></i> Contact</a></h4>
      <ul>
        <li><a href="#">Phone</a></li>
        <li><a href="#">Email</a></li>
        <li><a href="#">Location</a></li>
      </ul>
    </div>
</nav>

html

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Know Everything About HTML With HTML Experts

HTML Assignment Help Australia @30% OFF from Sample Assignment, with Our Best HTML assignment help experts. Get HTML homework help online at affordable price. 100% Plag free assignment solution.

Commonly Used HTML Tags with Examples

HTML tags are keywords used in HTML to display web-pages with certain properties. They are further used for defining HTML elements. An HTML element consists of a starting tag.

HTML Basics to Learn HTML for Web Development

HTML is the mark-up language most websites are written in. In this article, we will delve into the most basics of HTML like tags and elements that are of utmost importance while writing any code in HTML. These tags help in the structuring and display of content on the web pages.

Types, Effects and Attributes

Learn about HTML Button & various effects on these buttons like ripple, fade-in & pressed. Learn types of HTML buttons - shaded button, animated button etc.

The Essential HTML Basics Guide for Beginners

Coming as a beginner into HTML can be difficult, especially for the amount of default properties and behaviors that are in place and nobody tells you about it. In this article, I am going to show you how these things work, how you can modify their default behavior, and help you get a better understanding of HTML that will be useful any time there is a roadblock in the rendering of your page.