/ Published in: CSS
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
HTML <div id="navcontainer"> <ul id="navlist"> <li id="active"><a href="#" id="current">Item one</a></li> <li><a href="#">Item two</a></li> <li><a href="#">Item three</a></li> <li><a href="#">Item four</a></li> <li><a href="#">Item five</a></li> </ul> </div> CSS #navcontainer { margin: 0; padding: 0 0 0 12px; } #navcontainer UL { list-style: none; margin: 0; padding: 0; border: none; } #navcontainer LI { display: block; margin: 0; padding: 0; float: left; width: auto; } #navcontainer A { color: #444; display: block; width: auto; text-decoration: none; background: #DDDDDD; margin: 0; padding: 2px 10px; border-left: 1px solid #fff; border-top: 1px solid #fff; border-right: 1px solid #aaa; } #navcontainer A:hover, #navcontainer A:active { background: #BBBBBB; } #navcontainer A.active:link, #navcontainer A.active:visited { position: relative; z-index: 102; background: #BBBBBB; font-weight: bold; } #subnav { position: relative; top: -1px; z-index: 101; margin: 0; padding: 0px 0 3px 0; background: #BBBBBB; border-top: 1px solid #fff; border-bottom: 1px solid #aaa; } #subnav UL { list-style: none; margin: 1px 0 0px 13px; padding: 0px; border-right: 1px solid #fff; border-left: 1px solid #aaa; } #subnav LI { position: relative; z-index: 102; display: block; margin: 0; padding: 0; float: left; width: auto; } #subnav A { color: #fff; display: block; width: auto; text-decoration: none; margin: 0; padding: 2px 12px 2px 10px; } #subnav A:hover, #subnav A:active { color: #444; } #subnav A.active:link, #subnav A.active:visited { color: #444; } #subnav BR, #navcontainer BR { clear: both; }
URL: http://css.maxdesign.com.au/listamatic/horizontal10.htm