Horizontal menu : Navigation Bar « CSS Controls « HTML / CSS






Horizontal menu

  

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title></title>
    <style type="text/css">
#header {
  float: left;
  width: 100%;
  background-color: white;
  padding-top: 0;
  margin-top: 0;
  background: #ccc;
}

#header h5 {
  display: none;
}

#header ul {
  margin: 0;
  padding: 10px 10px 0;
  list-style: none;
}

#header li {
  float: left;
  margin: 0;
  padding: 0;
}

#header a {
  display: block;
}

#header li {
  float: left;
  background: yellow;
  margin: 0;
  padding: 0;
}

#header a {
  display: block;
  background: gold;
  padding: 5px 15px;
  color: #ccc;
  text-decoration: none;
}

#header #current {
  background: red;
}

#header #current a {
  background: pink;
  color: black;
}
</style>
  </head>
  <body>
  <div id="header">
    <ul>
      <li><a href="http://www.java2s.com">Home</a></li>
      <li><a href="http://www.java2s.com">Home</a></li>
      <li><a href="http://www.java2s.com">Home</a></li>
      <li><a href="http://www.java2s.com">Home</a></li>
      <li id="current"><a href="http://www.java2s.com">Home</a></li>
      <li><a href="http://www.java2s.com">Home</a></li>
     </ul>
  </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.Expandable left bar
6.CSS tab based navigational bar
7.Nested List style
8.Styled tab navigation
9.Negative Margins example
10.Horizontal navigation bar with anchor and list
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