Jump to content

Change background on mobile for one page only

Recommended Posts

Hi! Trying to change the background on the mobile version of the site for section 1 only to a different image better suited for mobile. 

 

I used the following in the CSS code, and it worked, but for every page on the site whereas I only need it on the home page. 

 

When I added it to the page header code injection for the specific page it did make any changes at all. 

 

@media only screen and (max-width: 640px)

{

#page .page-section:nth-child(1) .section-background img {opacity:0 }

#page .page-section:nth-child(1) .section-background {

background-image: url(https://static1.squarespace.com/static/636ac17575f6c9285d9ce537/t/636c3313efe57d0fa530edba/1668035358549/mobilev2.png);

background-size: cover;

background-position: center;

background-repeat: no-repeat;

}

}

Link to comment
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

18 hours ago, tsphillips said:

Hi! Trying to change the background on the mobile version of the site for section 1 only to a different image better suited for mobile. 

 

I used the following in the CSS code, and it worked, but for every page on the site whereas I only need it on the home page. 

 

When I added it to the page header code injection for the specific page it did make any changes at all. 

 

@media only screen and (max-width: 640px)

{

#page .page-section:nth-child(1) .section-background img {opacity:0 }

#page .page-section:nth-child(1) .section-background {

background-image: url(https://static1.squarespace.com/static/636ac17575f6c9285d9ce537/t/636c3313efe57d0fa530edba/1668035358549/mobilev2.png);

background-size: cover;

background-position: center;

background-repeat: no-repeat;

}

}

Can you share your site with protected password so I can take a look?

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, Keyword Highlighter
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.