0

Well, I've got div with 3 elements in it:

<div> 
    <img src="http://localhost/images/4.png" alt="alt 4" class="background">
    <img src="http://localhost/images/4_icon.png" alt="alt 4" class="icon">
    <p>
        bla bla
    </p>
</div>

and css such as:

.icon:hover ~ .background {
    transform: scale(1.2)
}

but no idea why, it doesn't work.

miloszowi
  • 36
  • 5

1 Answers1

0

Just switch the icon with the background element. The tilde only works on the next elements. See example below. The other solution would be using js.

<div> 
    <img src="http://localhost/images/4_icon.png" alt="alt 4" class="icon">
    <img src="http://localhost/images/4.png" alt="alt 4" class="background">
    <p>
        bla bla
    </p>
</div>
Wilco
  • 23
  • 6