Hover on an element to change color - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to change Color

Description

Hover on an element to change 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">
.SomeClass {<!--from   w  w  w .  jav  a 2s.  c  om-->
   color:Chartreuse;
}

.SomeClass:hover {
   color:yellow;
}

#SomeID:hover {
   color:blue;
}
</style> 
 </head> 
 <body> 
  <div class="SomeClass">
    Lorem 
  </div> 
  <div class="SomeClass" id="SomeID">
    Lorem 
  </div> 
  <div class="SomeClass">
    Lorem 
  </div>  
 </body>
</html>

Related Tutorials