Jump to content

Create a hover effect on image block (Have tried 5+ CSS code snippets and cannot get it to work)

Go to solution Solved by tuanphan,

Recommended Posts

I've spent the last couple of hours trying several different CSS code snippets found on other forum posts, and asked ChatGPT to write a snippet, and cannot get any to work. 

There are three images on my home screen, i'm trying to get them to lighten when the mouse hovers over them 

Please help!

Link to comment
  • Replies 8
  • Views 570
  • Created
  • Last Reply

Top Posters In This Topic

On 7/13/2024 at 10:31 AM, tuanphan said:

You can use this code to Website Tools > Custom CSS

div#block-e05ca4f3a9549e2c02bd:hover img, div#block-268daae426b3587a1f7b:hover img, div#block-19a0ea73c5dae009babc:hover img {
    opacity: 0.5;
}

Thanks for this however it hasn't worked. 
(I updated the block IDs so they are correct to what's on the page since I changed it, but still no dice) 

The updated page is this
https://www.tundratides.com/discover

The block IDs i'm using are: 

#block-e05ca4f3a9549e2c02bd
#block-268daae426b3587a1f7b
#block-19a0ea73c5dae009babc 

What am I doing wrong? 

Link to comment
On 7/17/2024 at 1:56 AM, Tundra_Tides said:

Thanks for this however it hasn't worked. 
(I updated the block IDs so they are correct to what's on the page since I changed it, but still no dice) 

The updated page is this
https://www.tundratides.com/discover

The block IDs i'm using are: 

#block-e05ca4f3a9549e2c02bd
#block-268daae426b3587a1f7b
#block-19a0ea73c5dae009babc 

What am I doing wrong? 

I just tested it again on my browser and it still works. You try move the code to top of Custom CSS box.

If it still doesn't work, you can keep the code in CSS box, I can check again easier.

div#block-e05ca4f3a9549e2c02bd:hover img, div#block-268daae426b3587a1f7b:hover img, div#block-19a0ea73c5dae009babc:hover img {
    opacity: 0.5;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
4 hours ago, tuanphan said:

I just tested it again on my browser and it still works. You try move the code to top of Custom CSS box.

If it still doesn't work, you can keep the code in CSS box, I can check again easier.

div#block-e05ca4f3a9549e2c02bd:hover img, div#block-268daae426b3587a1f7b:hover img, div#block-19a0ea73c5dae009babc:hover img {
    opacity: 0.5;
}

Should I be putting this in the advanced menu -> Custom Code Injection, or somewhere else? 

It's the only code in there

Screenshot 2024-07-19 at 14.51.56.png

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.