Jump to content

Hover area for Image Card block - only on image

Recommended Posts

Posted

Site URL: https://corn-sphere-9exs.squarespace.com/

Hello,

I'm using Image Card blocks as links.

I set the image itself to be the button, so I set 'Image Link' to 'On Image' in the Design tab of the image block.
I then set a hover effect which changes the image to grayscale with the following code:

.image-block:hover img {
  filter: grayscale(100%);
  transition: all .2s ease-in-out; 
}

This works fine, but the image goes to greyscale whenever I hover on any part of the Image Card - so even if hovering over the title or paragraph, the image is still on hover.
I'd like to only have this effect when the cursor is over the image itself - aka the part where clicking actually redirects. Additionally, this should only happen on the Image Card block and not on other images. 

url: https://corn-sphere-9exs.squarespace.com/
password: help

Thanks in advance!

  • 2 weeks later...
  • Replies 1
  • Views 348
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.