Jump to content

Help changing background image on mobile please?

Recommended Posts

Site URL: https://guava-guppy-sx4w.squarespace.com/

 

URL: https://guava-guppy-sx4w.squarespace.com/

PW : test 

Hi,

I've been able to follow a number of forum topics on this subject but cant seem to get the code to work. 

Have two backgrounds set on the home page, would like to hide the landscape one in mobile and the portrait one in desktop / tablet modes.  Tried to locate the section ID's but that didnt seem to work. 

Should end up looking like the images below.

Many thanks!

 

1610502755_Screenshot2020-12-10at09_23_09.thumb.png.83cbe05390b8049640c796d52845818b.png135826879_Screenshot2020-12-10at09_23_26.thumb.png.f57cd163fd9211942f6ca47740362963.png

Link to comment
  • Replies 2
  • Views 352
  • Created
  • Last Reply
19 minutes ago, Murso500 said:

Site URL: https://guava-guppy-sx4w.squarespace.com/

 

URL: https://guava-guppy-sx4w.squarespace.com/

PW : test 

Hi,

I've been able to follow a number of forum topics on this subject but cant seem to get the code to work. 

Have two backgrounds set on the home page, would like to hide the landscape one in mobile and the portrait one in desktop / tablet modes.  Tried to locate the section ID's but that didnt seem to work. 

Should end up looking like the images below.

Many thanks!

 

1610502755_Screenshot2020-12-10at09_23_09.thumb.png.83cbe05390b8049640c796d52845818b.png135826879_Screenshot2020-12-10at09_23_26.thumb.png.f57cd163fd9211942f6ca47740362963.png

You can follow these steps:

1. Find the section id via this extension

Chrome Web Store - Extensions (google.com)

2. Click on it icon to get the id and replace in the below snippet (which I help you find already)

@media only screen and (max-width: 640px) {
      section[data-section-id="5fd13362283fb005030b266b"] .section-background {
        background-image: url("https://images.squarespace-cdn.com/content/v1/5fa468b9be882012fbd59ab2/1607594230382-R11FF85OTT6H1NXNN9PP/ke17ZwdGBToddI8pDm48kGzoLUibUFZ8FEdlbHgnGb97gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z5QHyNOqBUUEtDDsRWrJLTmci781IWyUbYPSwZLERvZocHiUFKcWq0joGojCpOEnQ_66Ow-oYb1umVRKEE_zXj0/CS-GIF-HOMEPAGE-tall.gif");
        background-size: cover;
        background-repeat: no-repeat;
      }
      section[data-section-id="5fd13362283fb005030b266b"] .section-background img {
        opacity: 0;
      }
}

image.png.61a2f37a9d92bdd01a595f45d13d1a5e.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

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.