hover current li and its parent li - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover on list

Description

hover current li and its parent li

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:hover {<!--from  w  w  w.  j  a  va  2 s  .c o  m-->
   background-color:Chartreuse;
}

li:hover {
   font-weight:bold;
}

li:hover ul {
   background-color:yellow;
   font-weight:normal;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li>Lorem i 
    <ul> 
     <li>Lor</li> 
     <li>Lorem 
      <ul> 
       <li>Lor</li> 
       <li>Lor</li> 
      </ul> </li> 
    </ul> </li> 
   <li>Lorem i 
    <ul> 
     <li>Lor</li> 
     <li>Lorem 
      <ul> 
       <li>Lor</li> 
       <li>Lor</li> 
      </ul> </li> 
    </ul> </li> 
  </ul>  
 </body>
</html>

Related Tutorials