Change a separate div color on hover - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Color

Description

Change a separate div color on hover

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">

#mycolor:hover + #tobechanged {<!--from ww w .ja v  a2  s  .c o m-->
   background:yellow;
}


      </style> 
 </head> 
 <body> 
  <div id="mycolor"> 
   <a id="changecolor">Change Color</a> 
  </div> 
  <div id="tobechanged">
    Change My Color 
  </div>  
 </body>
</html>

Related Tutorials