0

I'm having issues finding the right CSS selectors. I want to zoom into an image when I hover over the caption (h2).

already tried .dish h3:hover .zoom img { transform: .... }

here's the code:

   
  

   
  <div class="flexContainer">
      <div class="dish">
        <div class="zoom">
          <img src="images/summerrolls.jpg" >
        </div>
        <h2>Summerrolls</h2>
      </div>
disinfor
  • 10,865
  • 2
  • 33
  • 44
  • With your current markup, you cannot do what you want with CSS, since there is no previous sibling selector. If you can move the `dish` markup after the `

    ` then you can. Otherwise you need to use JavaScript.

    – disinfor Nov 18 '20 at 19:55
  • "*already tried `.dish h3:hover .zoom img { transform: .... }`*" - where in your HTML is there an `h3` element? Are you sure you've provided a snippet in accordance with the [Minimal, Reproducible Example guidelines](https://stackoverflow.com/help/minimal-reproducible-example)? – esqew Nov 18 '20 at 19:57

0 Answers0