1

This work good ..

#a:hover + #b {
background: #ccc
}

<div id="a">Div A</div>
<div id="b">Div B</div>

but the opposite does not work. It's a solution for that ??

#b:hover + #a {
background: #ccc
}
user2039290
  • 104
  • 7

1 Answers1

1

You cannot select previous siblings using CSS. You could alternatively use jQuery solution to do that!

nairvijays
  • 181
  • 8