CSS selector ~ targeting a class while hovering another class

24 Views Asked by At

i'm trying to target a class when i'm hovering another class. I want to taget .colonne-gauche when hovering .behance

my html

<body>
<article>
 <h1 class="test">lorem<a href="#" class="behance"> portfolio</a></h1>
</article>

<div id="animation-2d">
 <div class="grille">
   <div class="colonne-gauche">
    <div class="gauche-haut"></div>
   </div>
  </div>
 </div>
</body>

This works

article:hover ~ #animation-2d .gauche-haut  { background-color: yellow; }

But when i tried to go deeper, like this :

article .behance:hover ~ #animation-2d .gauche-haut  { background-color: yellow; }

I does'nt work, any ideas ? Thanks

0

There are 0 best solutions below