DaVor Posted November 12, 2013 Report Share Posted November 12, 2013 Hi, trying to add submenus to a menubar that I coded with css, can someone show me how to add submenus to the code below. Thanks <body> <div id="logo">Content for id "logo" Goes Here</div> <div id="picture">Content for id "picture" Goes Here</div> <div id="content">Content for id "content" Goes Here</div> <div id="menubar"> <ul> <li><a href="#"> Home</a> <ul> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> </ul><!--closing of inner ul tag--> </li><!--end of li tag--> </ul><!--end of menubar ul tag--> <ul> <li><a href="#"> Home</a> <ul> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> </ul><!--closing of inner ul tag--> </li><!--end of li tag--> </ul><!--end of menubar ul tag--> <ul> <li><a href="#"> Home</a> <ul> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> </ul><!--closing of inner ul tag--> </li><!--end of li tag--> </ul><!--end of menubar ul tag--> Quote Link to comment Share on other sites More sharing options...
Andrea Posted November 12, 2013 Report Share Posted November 12, 2013 <ul> <li><a href="#"> Home</a> <ul> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> </ul><!--closing of inner ul tag--> </li><!--end of li tag--> <li><a href="#"> Home</a> <ul> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> </ul><!--closing of inner ul tag--> </li><!--end of li tag--> ... </ul><!--end of menubar ul tag--> Almost what you had, but your main ul doesn't close until the end. Quote Link to comment Share on other sites More sharing options...
DaVor Posted November 12, 2013 Author Report Share Posted November 12, 2013 Thanks for your help, is it possible to insert the code in my code to show where to put it, then I can do the same with the other menus. Also what style sheet do I reference the code to i.e. #menu ?? ?? ?? ??. Thanks much.... DaVor <ul> <li><a href="#"> Home</a> <ul> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> </ul><!--closing of inner ul tag--> </li><!--end of li tag--> <li><a href="#"> Home</a> <ul> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> <li><a href="#"> Link 1</a></li> </ul><!--closing of inner ul tag--> </li><!--end of li tag--> ... </ul><!--end of menubar ul tag--> Almost what you had, but your main ul doesn't close until the end. Quote Link to comment Share on other sites More sharing options...
Andrea Posted November 12, 2013 Report Share Posted November 12, 2013 Just compare your code with mine. You have several individual lists, but in order to do sublists, you insert a new ul group inside li tags. This tutorial addresses this in more detail: http://line25.com/tutorials/how-to-create-a-pure-css-dropdown-menu Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.