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

Edited by paprockin
Link to comment

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.