Please could someone make the following horizontal menu bar, with sub-menus work? Ideally with red background and grey hover state and with no jQuery just CSS.
I have tried countless times but can't get it to work properly. I was just about to chuck my laptop out of the window when I thought about the good folk on this forum!
I have supplied the basic CSS with no styling for the sub-menus.
Thanks in anticipation!
Code:<ul id="navtabs"> <li><a id="leftmostitem" href="http://www.dynamicdrive.com/">Home</a></li> <li><a href="#">Tab1</a></li> <li><a href="#">Tab2</a> <ul> <li><a href="#">Sub Item 1.a</a></li> <li><a href="#">Sub Item 1.b</a></li> <li><a href="#">Sub Item 1.c</a></li> <li><a href="#">Sub Item 1.d</a></li> </ul> </li><li><a href="#">Tab3</a></li> <li><a href="#">Tab4</a></li> <li><a href="#">Tab5</a></li> </ul><ul id="navtabs"> <li><a id="leftmostitem" href="http://www.dynamicdrive.com/">Home</a></li> <li><a href="#">Tab1</a></li> <li><a href="#">Tab2</a> <ul> <li><a href="#">Sub Item 1.a</a></li> <li><a href="#">Sub Item 1.b</a></li> <li><a href="#">Sub Item 1.c</a></li> <li><a href="#">Sub Item 1.d</a></li> </ul> </li><li><a href="#">Tab3</a></li> <li><a href="#">Tab4</a></li> <li><a href="#">Tab5</a></li> </ul> [ICODE] #nav {width: 970px; padding: 0px 8px 0px 8px;} #navtabs{ margin: 0; padding: 0; font: bold 10px Tahoma; background: url(img/greynavbg.jpg) repeat-x; list-style: none; float: left; width: 950px; } #navtabs li{ float: left; } #navtabs li a{ float: left; color: #666666; padding: 5px 20px 10px 20px; text-decoration: none; background: url(img/greybg.jpg) top right no-repeat; border-top: 1px solid #b0b0b0; border-bottom: 0px solid #333333; } #navtabs li a#leftmostitem{ border-left: 1px solid #cf3638 ; } #navtabs li a#rightmostitem{ border-right: 1px solid #cf3638 ; background-position: top left; } #navtabs li a:hover{ color: white; background-image: url(img/redoverbg.jpg); border-top: 1px solid #cf3638; }



Reply With Quote

Bookmarks