October 6, 201115 yr Hi . I have successfully learnt to create a CSS sprite Image based navigation menu.But now I need to create a drop down menu for one main menu option(something like this http://www.nandos.co.uk/). I see codes which use jquery and creating child ul inside li's but I am not clear how it works. CSS ul#menu{ width:980x; list-style:none; float:left; } ul#menu li { display: inline; } ul#menu li a { display:block; overflow:hidden; height:76px; float:left; background-image:url('images/mainmenu.jpg'); text-indent: -9999px; } ul#menu li a.home { width: 173px; background-position: 0 0; } ul#menu li a.gallery{ width: 210px; background-position: -173px 0; } ul#menu li a.menu { width: 231px; background-position: -383px 0; } ul#menu li a.location { width: 223px; background-position: -614px 0; } ul#menu li a.blog{ width: 143px; background-position: -837px 0; } ul#menu li a.home:hover, ul#menu li a.home:focus { background-position: 0 -76px; } ul#menu li a.gallery:hover, ul#menu li a.gallery:focus { background-position: -173px -76px; } ul#menu li a.menu:hover, ul#menu li a.menu:focus { background-position: -383px -76px; } ul#menu li a.location:hover, ul#menu li a.location:focus { background-position: -614px -76px; } ul#menu li a.blog:hover, ul#menu li a.blog:focus { background-position: -837px -76px; } html <div id="nav"> <ul id="menu"> <li><a href="index.html" class="home" >home</a></li> <li><a href="gallery.html" class="gallery" >gallery</a> <ul> <li><a href="#">Branch1</a></li> <li><a href="#">Branch2</a></li> </ul></li> <li><a href="main_menu.html" class="menu">menu</a></li> <li><a href="location.html" class="location">location</a></li> <li><a href="blog.html" class="blog">uc</a></li> </ul> </div> So far this is my code and I am stuck totally.. Thanks for your help in advance ! Edited October 6, 201115 yr by Renaissance-Design Please use the code button or tags to format your code.
Create an account or sign in to comment