Jump to content

Layered Photos Stacking Improperly

Recommended Posts

Hey everyone! On a site I am working on I am trying to layer two images of a neon sign (One with the sign off, and one with the sign on), so when the user hovers the mouse over the "turned off" image, the sign turns on. I found the code for how to do this online, and it works great on the backend, but when I got to publish for some reason the top image scales out and does not line up anymore. The two images are the exact same resolution and should lineup perfectly as they do when I'm editing. Any thoughts or ideas why this is happening? Code below, and screenshots are attached. 

https://www.thepridebeautylounge.com/

Password: TPBL

 

Code:

<div class="image-swap">
  <img src="https://static1.squarespace.com/static/5ef632f039c60326990986d8/t/5eff89a5fcd86f0cfeb88abc/1593805226929/WEB_The+Pride+Beauty+Lounge+Logo+Rectangle+Grey.jpg">
  <img src="https://static1.squarespace.com/static/5ef632f039c60326990986d8/t/5eff89b4e5e0f777e3f8f8f0/1593805244836/WEB_The+Pride+Beauty+Lounge+Logo+Rectangle+Pink.jpg">
</div>

- - - - - -

Custom CSS:

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

Screen Shot 2020-07-04 at 11.00.05 AM.png

Screen Shot 2020-07-04 at 11.00.24 AM.png

Screen Shot 2020-07-04 at 11.00.32 AM.png

Link to comment
  • Replies 3
  • Created
  • Last Reply
  • 4 months later...
On 11/5/2020 at 6:10 AM, possejadon said:

Did this work for you @KG1234 ? I'm experience the same issue and can't seem to fix it with the above code. 

If you share site url, we can check easier

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.