Jump to content

How do I make the secondary image on hover over the same size as the primary image?

Recommended Posts

Site URL: https://www.ddrglobal.com/

Hi,

My hover over images on the Squarespace dashboard look great and work exactly how I would like them to work. However, on my live site, the secondary images that appear on hover over are smaller than I would like.

How can I ensure that the images stay the same size on the live site?

Here is the custom-css code I am using:

.image-swap img:nth-child(1) {position: absolute;
left: 0;
right: 0;
text-align: center;
transition: .5s;}

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

 

Hover Over Image Issue.jpg

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

Try this custom css

.image-swap {
  padding: 50%;
}
.image-swap img:nth-child(1) {
  z-index: 2;
}
.image-swap img:nth-child(2) {
  z-index: 1;
}
.image-swap img {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  transition: .5s;
}

image.thumb.png.20e27fceceac5dd9bb3d585a5c664f0d.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Archived

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.