Absolute positioning ul inside another ul - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Absolute positioning ul inside another ul

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">
ul.l2 {<!-- w  w w  . j  a va  2 s. c  o m-->
   background-color:Chartreuse;
   display:none;
   position:absolute;
   z-index:100;
}

.menu li:hover ul.l2 {
   display:block;
}
</style> 
 </head> 
 <body> 
  <div id="wrapper"> 
   <ul class="menu"> 
    <li> item 1 
     <ul class="l2"> 
      <li>item 1.1</li> 
      <li>item 1.2</li> 
     </ul> </li> 
    <li>item 2</li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials