Home Coding

CSS3 Navigation Menu Tutorial with Notification Badges

Topic: HTML / CSS3
Difficulty: Beginner
Estimated Completion Time: 30 mins

Navigation menus are a vital part of today’s websites and designs. Without them functioning correctly, visitors would be lost and our websites would lose one great feature. When it comes to navigation menus, you have to be sure they work well, look great and are suitable for all the major web browsers.

In this tutorial I will be showing how to make minimal CSS3 navigation menu that can be customized to fit your projects requirements and looks.

CSS3 Navigation Menu

STEP 1 – HTML Markup

To start off, we will need to add our HTML markup. The markup is super simple and the HTML we will be using would be in any simple website menu. Now, I included the notification badges in my menu; If you would like to remove the badges all is needed is to simply remove the badge tags in your HTML.

Now that we have the basic HTML done, go ahead and create another file in the same directory as your HTML; I named mine style.css. Next we’ll simply link the HTML to the CSS stylesheet. All you have to do is add the code below in between the two header tags in your HTML. Make sure you replace the location and name if needed.

 STEP 2 – Layout with CSS

Now that we are finished with the HTML, we will now need to create the CSS in the file we made a bit earlier. The first CSS code will style the layout and body for the menu on the webpage. I added some fonts that will style the menu a little later, change this and the colors to your liking.

We will then create the layout so the menu is not all over the webpage by adding the CSS code below.

To finish off this step, we will then finish the layout for the menu itself.

STEP 3 – Beginning the Looks of Our Menu

What’s a menu without a good and clean look? Let’s now begin the process of creating the actual looks of the menu. Start by adding the small code below to your CSS menu. This small peice of CSS will style the menu border, border location, height, the size and color of our font and our text shadow and clarity.

Now, you may want to add a background within the parameter of our menu border. Let’s do this by adding the CSS below into the next line right after text-shadow element line.

STEP 4 – Menu Hover and Active Page Highlight

Now that we have the general look of our menu we have all but two more vital additions we need to build unto our menu: the menu hover and the active page highlight. The menu hover will add shading around the navigation item the mouse is hovering over, the active page highlight will highlight the page you are currently browsing. These to additions are totally optional but, they give the menu a nice feature. We can now add the menu hover with the code below, feel free to customize the colors to your liking.

We can now finish up the main design of the menu by adding the active page highlight. Now, this is a pretty simple menu feature so, not much need to explain.

STEP 5 – Optional Notification Badges

If desired, we can now add the notification badges. I kept this out of the main design of the menu, just because the badges commonly are not used in most websites. By adding the CSS below, you will add the layout of the badge or badges.

We now may want to add some style and color to these badges. Simply, add and customize this code to your liking and you have an awesome notification badge on your menu. If you would like to add more than one color to your notification badges just add the below code as many times need and change the reference name; In my case it was nav .badge. After adding another badge element in CSS just customize colors and so on to your liking. Be sure to change the reference name in the HTML code!

CSS3 Navigation Menu Tutorial with Notification Badges

Conclusion

We’re now finished with our simple but beautiful menu built with CSS3. Remember, you can always customize the CSS to fit the needs of your project. I hope you enjoyed this tutorial and the navigation menu is useful to you and your projects.

Download CSS3 Menu

I'm amateur web designer and developer. In my spare time I read books, play football.

2 COMMENTS

  1. Great tutorial thanks for posting! CSS3 offers many useful techniques for building navigations both vertical and horizontal. This will surely be of use to some web developers out there.

Leave a Reply