Reputation: 1
I have 3 divs
in this order 1 - 2 - 3
I want to change the background of 1 & 3 when I hover over 2 (using css)
so far only div 3 will change
Upvotes: 0
Views: 309
Reputation: 41
Use the classes to style them on hover in your CSS. Example:
<div class="one"> First </div>
<div class="two"> Second </div>
<div class="three"> Third </div>
.one:hover, .three:hover {
background: pink;
}
Upvotes: 1