How does the css selector select elements at its level?

<div class="a"></div>
<div class="b"></div>
abcss
Mar.31,2021

the answer given by the brother upstairs can solve the example in your problem perfectly.
+ only applies to parallel elements immediately following. If there is more element c between an and b, then using .a: hover+.b is invalid.
it is recommended to use ~ , which can select all subsequent peer elements of this element

  

.a: hover+.b

Menu