Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Hover Over Effect - Code is resizing my photos?


MML997

Question

Site URL: https://www.worqflowsolutions.com/copy-of-home

On our site I am trying to implement a hover over effect in the 'Our Expertise' section of our Home Page. I am currently using this code in our custom CSS:

.image-swap-1 img:nth-child(1) {
 position: absolute;
  transition: 1s;
}

.image-swap-1 img:nth-child(1):hover {
 opacity: 0;
}

Then I am using this code within a code block to decide which photo goes on top:

<div class="image-swap-1">
  <img src="https://static1.squarespace.com/static/577c578f20099ef8087b6a74/t/60c37fa8d794e739ca421f73/1623424937257/ERP.png">
  <img src="https://static1.squarespace.com/static/577c578f20099ef8087b6a74/t/60c38092c1f563780a25c5b7/1623425170318/ERP+-+Float+over.png">
</div>

The issue I have on the site is that it seems to make the pictures different sizes, and they aren't aligned prior to the hover effect either (you can see the corner of the lower picture). I made the photos in Canva and made sure they were both the same scale, so I'm not sure if there is an easy fix, but any help would be most appreciated. 

 

Thanks!

Link to comment
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 0

Hi. You can follow this guide to add image hover effect.

Email me if you have need any help (free, of course.). Answer within 24 hours.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care - Learn CSS - Custom Popup - Testimonial Slider

I'm Tuan, blogger/owner of a free library for children in Vietnam. Helping the community is a hobby. Contact me via email.

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