Ul li hover to change background color - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to change Color

Description

Ul li hover to change background color

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">
#nav1 ul li {
   display:inline;
   background-color:Chartreuse;
   padding:6px 6px 6px 6px;
   border-radius:6px 6px 0px 0px;
}

#nav1 ul li:hover {
   background-color:yellow;
}
</style> <!--from   w w w.  jav a 2  s.c  om-->
 </head> 
 <body> 
  <div class="nav" id="nav1"> 
   <ul> 
    <li> <a href="#">Lore</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials