Jump to content

I want to display a different background image on mobile for every page

Recommended Posts

Hi

I'm desperately trying to change the background image for mobile as the desktop version makes the copy that overlays it difficult to read. I need to do this for every page of the website (5 in total). 

I've read many different posts and watched a lot of different YouTube videos. None of the CSS I've tried is working. 

For example I've tried this code, which doesn't work:
 

@media only screen and (max-width: 780px) {#collection-64f6f5c69386bb2b883244fb {

#page .page-section:nth-of-type(1) {

img {

display: none;

}

.sqs-block-image img {

display: block;

}

.section-background {

background: url("https://images.squarespace-cdn.com/content/64f6f4b8ca44186f5f04420c/19333f4d-a055-4992-ae2a-14cf7f7c9697/home-mobilehero-image.jpg?content-type=image%2Fjpeg");

background-repeat: no-repeat;

background-size: 100%;

}

}

  }}

When I click save, and view it on mobile nothing happens.

Could anyone help please?

Many thanks

Link to comment
  • Replies 1
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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.