make drop down menu stay open while hovering - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

make drop down menu stay open while hovering

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#nav-line2:not(.subMenu) {<!--from  w ww  .java2s  .  com-->
   list-style:none;
}

#nav-line2>li {
   display:inline-block;
   position:relative;
}

#nav-line2 .subMenu {
   position:absolute;
   z-index:1000;
   list-style:none;
   display:none;
   white-space:nowrap;
}

#nav-line2>li:hover>.subMenu {
   display:block;
   margin-left:0;
   left:0;
   border:2px solid Chartreuse;
   padding:0;
}
</style> 
 </head> 
 <body> 
  <ul id="nav-line2" style="float:left"> 
   <li> <a class="navlink" href="/whatwedo">Lorem ipsu</a> </li> 
   <li> <a class="navlink" href="/communities">Lorem ipsum</a> </li> 
   <li> <a class="navlink" href="/catalog">Lorem ipsum </a> </li> 
   <li> <a class="navlink" href="/studentprofiles">Lorem ipsum dolo</a> </li> 
   <li> <a id="about" href="/aboutme">Lorem</a> 
    <ul class="subMenu"> 
     <li> <a class="navlink" href="/about">Lorem ipsum dolor </a> </li> 
     <li> <a class="navlink" href="/accesgovernance">Lorem ipsum dolor sit </a> </li> 
    </ul> </li> 
   <li> <a class="navlink" href="/termsconditions" style="padding-left:10px">Lorem ipsum dolor </a> </li> 
  </ul>  
 </body>
</html>

Related Tutorials