Click to show child list item - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Click to show child list item

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.menudrop {<!--  w w  w  .j  a v a 2  s.c o  m-->
   display:none;
   background-color:Chartreuse;
}

li.primarylist a:focus + ul.menudrop {
   display:block;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li class="primarylist"> <a href="#" class="category1anchor" tabindex="0">Lore</a> 
    <ul class="menudrop"> 
     <li class="secondarylist">Lor</li> 
     <li class="secondarylist">Lor</li> 
     <li class="secondarylist">Lorem</li> 
    </ul> </li> 
  </ul>  
 </body>
</html>

Related Tutorials