HTML CSS examples for CSS Widget:Color
On hover of one div to change the color of another div
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #b:hover ~ #a { background-color: #ccc; } </style> </head> <!--from ww w . ja va 2s.c om--> <body> <div id="b"> Div B </div> <div> random other elements </div> <div> random other elements </div> <div> random other elements </div> <div id="a"> Div A </div> </body> </html>