Jump to content

Make footer the same color as section above it

Recommended Posts

Well to continue with the beforehand started background... that would be much more work I guess, but to start again the same background as the previous section had, that is easier:

const prevBgSrc = document.querySelector('#content .index-section:last-child img').src;
document.getElementById('footer').style.backgroundImage = `url(${prevBgSrc})`;

 

Jozsef Kerekes - Front-end developer and Squarespace enthusiast
My Blog: https://ui-workarounds.com
If you like my answer, please give me an upvote/like. Highly appreciated.

 

 

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.