1

Can I select and affect the parent div, when I am on over the child div with hover? My question is if it is possible and how, in advance I apologize for my English.

 <div class="container">
      <div class="child-1">Wa</div>
      <div class="child-2">sup</div>
 </div>

.container{
    background: red;
}

.child-1:hover > .container{
    background: blue;
}
  • Take a look at this post: https://stackoverflow.com/questions/8114657/how-to-style-the-parent-element-when-hovering-a-child-element – mpm Jan 23 '21 at 06:48

0 Answers0