Jump to content

Image Hover custom code not working.

Recommended Posts

I have some image blocks on a page and I am trying to get just some interaction by adding a hover state to them by just targeting the images using the section Data ID, but for some reason, I can't get it to work. If I change the size of the image just normally it works, but when I try to change it on hover it doesn't.. any help?  Here is my code:

 

section[data-section-id="6425e7c2d407585e86625dc3"] img {
  transform: scale(1) !important;
  transition: .4s ease all;
}

section[data-section-id="6425e7c2d407585e86625dc3"] img:hover {
  transform: scale(1.1) !important;
}

Here is the specific page: https://treetopbusiness.com/services

Link to comment
  • Replies 3
  • Views 464
  • Created
  • Last Reply

Top Posters In This Topic

Add this code. 

section[data-section-id="6425e7c2d407585e86625dc3"] .image-block:hover img {
  transform: scale(1.1) !important;
}

 

And remove this code

section[data-section-id="6425e7c2d407585e86625dc3"] img:hover {
  transform: scale(1.1) !important;
}

Edited by Web_Solutions

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment

@Web_Solutions I have a section on my page that includes video blocks with custom featured images. I want the custom featured image to go from grayscale to color when hovering over a specific video block. I have the custom featured images converted to grayscale but I can't seem to get the hover to work. Any suggestions?

--

[data-section-id="642665ba988b72265e7abe14"] img {
 transition: .5s ease-in-out; 

  filter: grayscale(1);
  }

[data-section-id="642665ba988b72265e7abe14"] img:hover { 

  filter: none;

}

Link to comment
On 4/3/2023 at 9:55 AM, briangagliardi said:

 I have a section on my page that includes video blocks with custom featured images. I want the custom featured image to go from grayscale to color when hovering over a specific video block. I have the custom featured images converted to grayscale but I can't seem to get the hover to work. Any suggestions?

--

[data-section-id="642665ba988b72265e7abe14"] img {
 transition: .5s ease-in-out; 

  filter: grayscale(1);
  }

[data-section-id="642665ba988b72265e7abe14"] img:hover { 

  filter: none;

}

If you share link to your site, we can check easier

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

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.