Change color of vertical menu's <li> on hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu Hover

Description

Change color of vertical menu's <li> on hover

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:nth-child(odd) {
   background-color:Chartreuse;
}

ul li:nth-child(even) {
   background-color:yellow;
}

ul li:hover {
   background-color:blue;
}
</style> <!--from  w w  w.  ja  va  2  s .c  o  m-->
 </head> 
 <body> 
  <ul> 
   <li>Lorem </li> 
   <li>Lorem </li> 
   <li>Lorem </li> 
   <li>Lorem </li> 
   <li>Lorem </li> 
   <li>Lorem </li> 
   <li>Lorem </li> 
   <li>Lorem </li> 
   <li>Lorem </li> 
   <li>Lorem i</li> 
  </ul>  
 </body>
</html>

Related Tutorials