javascript - CSS Jquery vertical navigation menu with horizontal submenus -
i'd create navigation menu this:
|main-item1| |main-item2| |sub-item1| |sub-item2| |sub-item3| |main-item3| |main-item4|
what see this:
|main-item1| |main-item2| |sub-item1| |sub-item2| |sub-item3| |main-item3| |main-item4|
i've found question here on stackoverflow, couldn't manage adapt code.
the html code have this:
<div> <nav> <ul id="mainmenu"> <li><a href="chi_siamo">chi siamo</a></li> <li><a href="servizi">servizi</a> <ul class="submenu"> <li> <a href="speciale">speciale</a> </li> <li> <a href="#">privati</a> </li> <li> <a href="">aziende</a> </li> <li> <a href="">cerimonie</a> </li> <li> <a href="">consulenza</a> </li> </ul> </li> <li><a href="location">location</a></li> <li><a href="contatti">contatti</a></li> <li class="last"><a href="partner">partner</a></li> </ul> </nav> </div>
and css:
#mainmenu { position: fixed; left: 20px; top: 50%; z-index: 999999; margin-top:-200px; } #mainmenu li { height: 40px; margin: 5px; position: relative; } #mainmenu { background: none repeat scroll 0 0 #333; color: #fff; display: block; font-family: folio; font-size: 30px; padding: 2px 15px; text-decoration: none; text-transform: uppercase; width: 160px; height: 40px; /*background: url(images/dotnav.png) 0 100% no-repeat;*/ /*text-indent: -10000px;*/ overflow: hidden; } #mainmenu a:hover, #mainmenu li.active { background-position: 0 0; } .submenu { list-style-type: none; position:relative; float:left; } .submenu li { display: inline; float:left; position:relative }
it ok use jquery plugin, because i'd add effect on hovering, thought better align css first.
thanks
try this:
#mainmenu>li { height: 40px; margin: 5px; position: relative; clear:both
}
and float links:
#mainmenu { float:left; background: none repeat scroll 0 0 #333; color: #fff; display: block; font-family: folio; font-size: 30px; padding: 2px 15px; text-decoration: none; text-transform: uppercase; width: 160px; height: 40px; overflow: hidden; }
Comments
Post a Comment