Simple Navigation Bar with HTML / CSS

Simple Navigation Bar with HTML / CSS

In this tutorial i am going to show you how to Simple Navigation Bar with HTML / CSS. The easiest ways is to use a simple unordered list as your HTML structure and then style it using CSS. With the right styling you can even achieve some creative effects Let’s get right into the code and build a simple menu.

HTML code:

The structure of the menu is just an unordered list with links inside each of the list items.

<ul class="nav">
  <li><a href="#">Home</a></li>
  <li><a href="#">About Us</a></li>
  <li><a href="#">Services</a></li>
  <li><a href="#">Products</a></li>
  <li><a href="#">Contact</a></li>

Nothing really exceptional to that list. You would naturally add real URLs to your web pages inside the href attribute. The only thing I added was a class of ‘nav’ just so we can refer to the menu later in css. The code as we have it now will look like:

Simple Navigation Bar with HTML / CSS

The HTML only menu is certainly workable and I’ve used something as simple in sites before. What we’re after here is a little something more so let’s dress it up a little with some css.

Complete CSS code

The complete code for our simple menu is:

ul.nav {
	height:36px; line-height:36px;
	background:#0d7963; /* you can change the backgorund color here. */
	font-family:Arial, Helvetica, sans-serif;
ul.nav li {
	border-right:1px solid #189b80; /* you can change the border color matching to your background color */
ul.nav a {
	padding:0 28px;
ul.nav a:hover,
ul.nav li.current a {

Here is how it looks after applying css style.

Simple Navigation Bar with HTML / CSS

If you’re beginner in css, I would recommend you to start learning CSS here