Change ul and li into one with nested structure - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Change ul and li into one with nested structure

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">
#topbar>li:hover ul {
   display:inline;
}

#topbar>li {
   float:left;
   margin-left:21px;
   margin-right:21px;
   font-family:"Georgia";
}

#topbar>li>ul {
   display:none;
   top:31px;
   position:absolute;
   border-style:solid;
   padding-left:11px;
   padding-right:11px;
   border-width:2px;
   background-color:Chartreuse;
   list-style-type:none;
}
</style> <!--from   w  ww.  j  av  a 2  s. c om-->
 </head> 
 <body> 
  <ul id="topbar"> 
   <li>Lorem i 
    <ul> 
     <li> <a href="#">Lo</a> </li> 
     <li> <a href="#">Lo</a> </li> 
    </ul> </li> 
   <li>Lorem 
    <ul> 
     <li> <a href="#">Lo</a> </li> 
     <li> <a href="#">Lo</a> </li> 
    </ul> </li> 
   <li>Lorem ip 
    <ul> 
     <li> <a href="#">Lo</a> </li> 
     <li> <a href="#">Lo</a> </li> 
    </ul> </li> 
  </ul>  
 </body>
</html>

Related Tutorials