CSS Hover

Changing DIV Backgound Color When Another DIV is Hovered Using CSS Only

Submitted by argie on
In this tutorial you will learn how to change div background when another div is hovered. I used this "~" symbol in CSS to perform changing div color when another div is hovered. The "~" symbol means that it will only select the first element that is immediately preceded by the former selector. Copy and apply the code bellow.

Creating Our HTML Display

The code bellow provide the visual display of our demo.