Hover over div and make another div change color - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Color

Description

Hover over div and make another div 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">

#id1:hover ~ #match3 {<!--  w  ww . j  a va 2 s  .  com-->
   color: red;
}


      </style> 
 </head> 
 <body> 
  <div id="id1">
    DIV 
  </div> 
  <div id="id2">
    DIV 
  </div> 
  <div id="id3">
    DIV 
  </div> 
  <div id="match1">
    a 
  </div> 
  <div id="match2">
    b 
  </div> 
  <div id="match3">
    c 
  </div>  
 </body>
</html>

Related Tutorials