html css navigation bar

Let’s create an HTML CSS Navigation Bar With Mouse Hover Effect. In other words, Simple Navbar without JavaScript.

You must have seen a navigation bar if reading this post or using the internet for the surfing web. Because every website has a navbar for providing a graphical user interface and showing information to users. Nowadays navbar is compulsory, that’s why HTML include <nav> tag specially for creating a navigation bar in their HTML 5 version.

Most of the navbars are built in HTML, CSS, and JavaScript or any JS library. Using JavaScript you can create a very creative and fully featured navbar. But today I will show you how to create a navigation bar using HTML and CSS only. Beginners who don’t know JavaScript or want a simple HTML and CSS based navbar, this is the perfect program for them.

CMS like WordPress, they also use many javascript libraries for creating a webpage. If you think WordPress create a simple navigation bar without JS, then you are wrong. If you are learning HTML and CSS now, then try to create programs using HTML CSS only. Because of these types of program improve your web design skill and make your HTML-CSS strong.

This is a pure HTML and CSS navigation bar, it has an animated underline effect on mouse hover. When I said this is a basic navbar many peoples think this program is non-stylish or attractive. But this looks pretty good and it has a cool hover effect. To get an idea of how this program looks like, just see this preview.

Preview Of Navbar With Mouse Hover Effect

See this video preview to know how this program actually.  Gets an example:

Now you can see how this program in visually. If you like this then go for source code given below.

You May Also Like:

HTML CSS Navigation Bar Source Code

Before sharing source code, let’s talk about how I created this program. I created this menu bar using <ul> and <li> HTML tag. I used font-awesome for creating icons. Basically, this program is mostly based on CSS before: and after: property.

For creating this program you have to create only 2 files. One for HTML, and one of CSS.  Follow the steps for creating this without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given here below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes.

That’s It. Now you have successfully created an HTML CSS navigation bar or navbar. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

16 COMMENTS

  1. Very helpful shaan, can you make an article how we can create mobile navigation as explained above… It should be like android app like navigation… Example freshmenu.Com mobile version

  2. Thank you for create this navigation bar shaan. Please make it responsive for all device like mobile, computer and tab.

  3. Hi Shaan, could you tell what you are using for displaying the code? Any plugin or simple html? It looks very clean and has essential toolbox at the top for every code box.

    • Hey, thank for your comment. I am using Crayon Syntax Highlighter free plugin for display code. Stay connected.

LEAVE A REPLY

Please enter your comment!
Please enter your name here