How to apply hover effect to an element immediately before?

0

I have the following structure:

<div>
   <img src="#">
   <button>Teste</button>
</div>
<div>
   <img src="#">
   <button>Teste</button>
</div>

I need when the mouse rests on a button in the image immediately before it is applied the effect transform:scale(1.5)

    
asked by anonymous 12.07.2017 / 23:05

1 answer

0

Do you want the effect to be applied to the image or the button? If you want the effect on the button, just replace img with button . Would that be your doubt?

img:hover {
  transform: scale(1.5);
}
<div>
   <img src="#">
   <button>Teste</button>
</div>
<div>
   <img src="#">
   <button>Teste</button>
</div>
    
12.07.2017 / 23:26