Hello readers, Today in this blog you’ll learn how to create a fully responsive navigation bar using HTML & CSS. Earlier, you learned to Create a working user registration form using PHP and MySQL.


What is Navigation Bar?

A navigation bar is a user interface area in a web page containing links to the different pages of a website. It may also include a logo, a search bar, and some buttons. A navigation bar is created in websites for redirecting users from one page to another or one section/div to another section/div. It is also known as the nav bar.


3 Tips to make Nav-bar Better

  • Use plain and simple design.
  • Add links to the main pages of your website with an awesome hover effect.
  • Make its minimum height at least 60 pixels.

 

Today I will show you how you can create a responsive navigation bar with a cool hover effect using HTML & CSS. To create this nav bar I haven’t used any CSS framework or javascript. It’s made of pure CSS.

 

The height of this nav bar is 80pixels on desktop and tablet devices and 60pixels on the mobile phone. I have given its background pure white and shadow at the bottom to make its design very simple and attractive. I haven’t used any icons in this nav bar. If you want to add the icons you can easily add them. You can see the logo is in text format but if you want to replace it with the image you can add them inside the <div class=”logo”></div> tag.

 

Now let's talk about how I make this fully responsive. The very essential thing to make it responsive is a checkbox. When the checkbox is checked navigation menu slides from left to right and if it's again unchecked the menu slides to left and disappears. You can see I have created a hamburger icon using three different div. That hamburger is connected to the checkbox. 


If you click the hamburger the checkbox will automatically check and vice versa. To make the user experience good I have given the awesome hover effect in the hamburger and menu. If you hover over the hamburger, the second and third line moves slowly toward the right and the color of the second line changes. And in menu items, if you hover them, a line with 5pixels height will appear moving from left to right.

 

If you’re feeling difficult to understand what I am saying. You can watch a full video tutorial on this program (Responsive Navigation Bar using HTML & CSS).


You Might Also Like

Video tutorial of Responsive Navigation Bar using HTML & CSS


All this navigation bar design is based on pure CSS. If you’re a beginner you can also create this type of nav bar. If you like this program (Responsive Navigation Bar using HTML & CSS) and want to get source code. You can easily get the source code of this program. To get the source codes you just need to scroll down.

Responsive Navigation Bar using HTML & CSS [Source Codes]

 

To create this program (Responsive Navigation Bar using HTML & CSS). First, you need to create two Files one HTML File and another one is CSS File. After creating these files just paste the following code into your file. First, create an HTML file with the name index.html and paste the given codes into your HTML file. Note it, you’ve to create a file with a .html extension.

HTML

Second, create a CSS file with the name style.css and paste the given code into your CSS file. Note it, you’ve to create a file with a .css extension.

CSS

 

That’s all, now you’ve successfully created a fully responsive navigation bar using HTML & CSS. If your code does not work or you’ve faced any errors/problems then please comment down. If you feel this article had helped you, please share it with your friends.


Post a Comment

Previous Post Next Post