html – How do I change an element’s css while hovering over an element which lies after it?


I want to change the opacity of .dividor to 0 while hovering over any of the other divs. I don’t know how to do this for the .secondDiv. I am just learning CSS.

HTML:

<div class="base">
   <div class="FirstDiv"></div>
   <div class="Dividor"></div>
   <div class="SecondDiv"></div>
</div>

My CSS:

.base > div:hover + div {
  opacity: 0;
}



Source link

Latest articles

Related articles

Leave a reply

Please enter your comment!
Please enter your name here