Jump to content

Hover Over Effect - Code is resizing my photos?

Recommended Posts

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

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. 



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


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.