Way to make a drop down menu fixed from the top with css - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Dropdown

Description

Way to make a drop down menu fixed from the top with css

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">
li {<!-- w ww  .j  a  v a  2  s  . co  m-->
   border:2px solid;
   padding:2px;
}

.main {
   list-style:none;
   position:relative;
}

.sub, .sub2 {
   list-style:none;
   position:absolute;
   display:none;
   width:76px;
}

.sub2 {
   float:left;
   left:76px;
   top:0px;
}

.main li:hover .sub,
.sub li:hover .sub2 {
   display:block;
}
</style> 
 </head> 
 <body> 
  <ul class="main"> 
   <li>Lorem 
    <ul class="sub"> 
     <li>Lorem i 
      <ul class="sub2"> 
       <li>Lorem i</li> 
       <li>Lorem ips</li> 
      </ul> </li> 
     <li>Lorem ip 
      <ul class="sub2"> 
       <li>Lorem i</li> 
       <li>Lore</li> 
       <li>Lorem i</li> 
      </ul> </li> 
    </ul> </li> 
  </ul>  
 </body>
</html>

Related Tutorials