Jump to content

Darkening Image on Hover without Dimming Title

Recommended Posts

Site URL: https://krill-bassoon-kb9t.squarespace.com

I am working on this website for a community organization and was trying to get these images to darken on hover. Each image is set to "poster" under the design tab and has a title with no subtitle. My code is seen below.

.sqs-block-image:hover .image-card-wrapper { filter: brightness(1); transition: .3s; cursor: pointer;}
.sqs-block-image:not(:hover) img { filter: brightness(1);}
.sqs-block-image:hover { filter: brightness(.5); transition: .3s; cursor: pointer;}

This code darkens the image but the title that is juxtaposed on top of the image is also darkened. Is there a way to adjust this code to darken only the image?

The website is https://krill-bassoon-kb9t.squarespace.com/schoolhistory

Link to comment
  • Replies 1
  • Views 330
  • Created
  • Last Reply

Just wanted to say that after playing around for a long time, I got my desired effect to work! Below is the CSS I ended up using if anyone also wants to accompish this.

.design-layout-poster:hover .image-card-wrapper { filter: brightness(1); transition: .3s; cursor: pointer;}
.design-layout-poster:not(:hover) img { filter: brightness(1);}
.design-layout-poster :hover { filter: brightness(.8);  transition: .3s; cursor: pointer;}

 

Link to comment

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.