Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Layered Photos Stacking Improperly


KG1234

Question

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
  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0
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.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...