tsphillips Posted November 11, 2022 Posted November 11, 2022 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; } }
Beyondspace Posted November 12, 2022 Posted November 12, 2022 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? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> No-code customisations for Squarespace
tsphillips Posted November 14, 2022 Author Posted November 14, 2022 I found the answer! it's #collection-(Your specific site ID) { (The code you want on this one specific page) } Shout out to this page for the answer! https://sf.digital/squarespace-solutions/how-to-apply-css-to-specific-pages-in-squarespace
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment