hover on child <li> elements - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover on list

Description

hover on child <li> elements

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>li:hover {
   background:yellow;
}

ul>li:hover>ul {
   background:white;
}
</style> <!--from   w ww  . j  a v  a  2s .c  om-->
 </head> 
 <body> 
  <nav> 
   <ul> 
    <li>Lorem ipsum dol</li> 
    <li>Lorem ipsum dolo</li> 
    <li> 
     <ul> 
      <li>Lorem ipsum dol</li> 
      <li> 
       <ul> 
        <li>Lorem ipsum dol</li> 
        <li>Lorem ipsum dolo</li> 
        <li>Lorem ipsum dol</li> 
       </ul> </li> 
      <li>Lorem ipsum dolo</li> 
      <li>Lorem ipsum dol</li> 
     </ul> </li> 
   </ul> 
  </nav>  
 </body>
</html>

Related Tutorials