Hover to change background color of Div with style - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div

Description

Hover to change background color of Div with style

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style type="text/css">
.mydiv<!--from w  w  w  .  ja  va  2 s .c o m-->
 {
   width:100px;
   height:100px;
   background-color:Chartreuse;
}

.mydiv:hover
 {
   background-color:yellow;
}
</style> 
 </head> 
 <body> 
  <div class="mydiv"> 
  </div>  
 </body>
</html>

Related Tutorials