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/


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

Edited by JRossiDDR
Link to comment

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;


Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. 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.