October 22, 2024
Chicago 12, Melborne City, USA
CSS

Get hover effect when hovering on text that is over the image


I am trying to get a hover effect when trying to hover over a text that is on top of my image.

You can see in this codesandbox that I am trying to scale my image when the cursor is hovering over it, however, I noticed the hover effect does not take place when the cursor is moving over the text. I guess that makes sense, since the text component is over the image.

One thing that I was exploring was using pointer-events:none, however, I can see that I lose the capability of copying the text from the image.

My question is, is it possible to get the transition effect on the image when the cursor moves around the text? Maybe there is something obvious that I am missing.

Note: I don’t want the text to scale, just the image.

Thanks in advance.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video