Add hover effect to UL LI anchor - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:a

Description

Add hover effect to UL LI anchor

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
ul {<!-- w ww.j a v a 2 s. c om-->
   list-style-type:none;
   margin:0;
   padding:0;
   overflow:hidden;
}

li {
   float:left;
}

li a {
   display:block;
   background-color:Chartreuse;
   text-align:center;
   color:yellow;
   padding:15px 17px;
   text-decoration:none;
   border:2px solid blue;
}

li a:hover {
   background-color:pink;
   color:WhiteSmoke;
}
</style> 
 </head> 
 <body translate="no"> 
  <div id="nav"> 
   <ul> 
    <li> <a href="Home.html"> <b> <font size="5">Home</font> </b> </a> </li> 
    <li> <a href="About.html"> <b> <font size="5">About</font> </b> </a> </li> 
    <li> <a href="ContactUs.html"> <b> <font size="5">Contact Us</font> </b> </a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials