0

I am trying to change the properties of the div by hovering over the image. I even used + and ~ . But it still doesn't work.

<div>
        <img class="img" src="pictures/img.png">
    </div>
    <div class="text"></div>
 .text {
            height: 100px;
            width: 100px;
            background-color: blue;
        }


        .img {
            height: 200px;
            width: 200px;
        }

        .img:hover+.text {
            height: 200px;
            width: 200px;
        } 
  • They obv. don't share the same parent. Place the .text after the img and it will work. – VXp Jul 19 '20 at 16:11

0 Answers0