Jump to content

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

Recommended Posts

Posted

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

  • Replies 1
  • Views 478
  • Created
  • Last Reply
Posted

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 (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

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.