Horizontal navigation bar with anchor and list : Navigation Bar « CSS Controls « HTML / CSS






Horizontal navigation bar with anchor and list

  

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Nav Bar Example</title>
<style rel="stylesheet" type="text/css">
body {
  background-color: #ffffff;
}

a:link,a:visited {
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
  color: #000000;
}

#topNav {
  width: 800px;
  position: relative;
  top: 10px;
  left: 10px;
  background: red;
  height: 32px;
  color: #cccccc;
  padding: 0px;
  margin: 0px;
}

#linkContainer {
  position: absolute;
  top: 10px;
  left: 10px;
  height: 16px;
  padding: 0px;
  margin: 0px;
  z-index: 1;
}

a.topNavLink {
  padding: 0px 5px 0px 5px;
  border-right: 1px solid #666666;
}

a#lastItem {
  border-right: none;
}

a.topNavLink:hover {
  background: gold;
}
</style>
</head>
<body> 
  <div id="topNav"> 
    <div id="linkContainer">
      <a href="#" class="topNavLink">Home</a>
      <a href="#" class="topNavLink">Products</a>
      <a href="#" class="topNavLink">Services</a>
      <a href="#" class="topNavLink">About Us</a>
      <a href="#" id="lastItem" class="topNavLink">Contact Us</a>
     </div> 
  </div>
</body>
</html>

   
  








Related examples in the same category

1.Left navigation bar
2.One column with top navigation bar
3.Right navigation bar
4.Left bar menu
5.Horizontal menu
6.Expandable left bar
7.CSS tab based navigational bar
8.Nested List style
9.Styled tab navigation
10.Negative Margins example
11.Horizontal menu with list
12.Using image only as the top navigation bar
13.Vertical Navigation
14.Horizontal Navigation
15.Highlight top navigation link when mouse hover
16.Links navigation at the bottom
17.One level top navigation bar
18.Navigation bar with selected item
19.Horizontal Nav