Change Background color on hover for ul - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to change Color

Description

Change Background color on hover for ul

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">
.mainlist {<!-- w w  w. j ava 2 s .co m-->
   list-style:none;
   margin-top:51px;
   margin-left:16px;
}

.submenu {
   list-style:none;
   display:list-item;
   margin:0px;
   padding:0px;
   width:16px;
}

.submenu li {
   margin-top:11px;
   float:left;
   display:inline;
   margin:6px;
   text-align:center;
}

.submenu:hover li {
   background-color:Chartreuse;
}

.submenu:hover li>a {
   color:yellow;
}

.submenu li i {
   font-size:26px;
   color:blue;
}

.submenu li a {
   margin-top:21px;
   font-size:21px;
   color:pink;
   font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}
</style> 
 </head> 
 <body> 
  <div style=""> 
   <nav id="sidenav"> 
    <ul class="mainlist"> 
     <ul class="submenu"> 
      <li> <i class="fa fa-home"></i> </li> 
      <li> <a href="#">Lore</a> </li> 
     </ul> 
    </ul> 
   </nav> 
  </div>  
 </body>
</html>

Related Tutorials