Navigation Menu with CSS

By jp112 | May 13th, 2009 | Category: Quickies
Navigation Menu with CSS

This is a quick and simple guide to make a horizontal navigation using CSS.

<div id=”nav”>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>Services</a></li>
<li><a href=”#”>Contact</a></li>
</ul>
</div>

css-nav1

Remove the bullets with this code:

#nav ul
{
list-style: none;
padding: 0;
margin: 0;
}

css-nav3

To make menu horizontal:

#nav li
{
float: left;
margin: 0 5px;
}

To make the horizontal items into boxes:

#nav li a
{
background: #fff bottom left repeat-x;
height: 30px;
line-height: 30px;
float: left;
width: 100px;
display: block;
border: 1px solid #dcdce9;
color: #0d2474;
text-decoration: none;
text-align: center;
}

Final Result:

css-nav2

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Technorati
  • TwitThis
  • Furl
  • LinkedIn
  • NewsVine
  1. It‘s quite in here! Why not leave a response?