Hover to change text color - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover to change Color

Description

Hover to change text 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">
#text1<!-- w  ww .ja  v  a2  s  .co m-->
 {
   color:Chartreuse;
}

#text1:hover + #text2
 {
   color:yellow;
}

#text2
 {
   color:blue;
}
</style> 
 </head> 
 <body> 
  <h1 id="text1">Lorem</h1> 
  <h1 id="text2">Lorem</h1>  
 </body>
</html>

Related Tutorials