Jump to content

How to add screensize parameters around a data-section-id

Recommended Posts

Site URL: https://star-fennel-h9p3.squarespace.com/


I have a section that is multicolored. It's perfect on mobile and desktop. But I want to change it to a single color on tablet only.

Here is my current css:

[data-section-id="60b93ddcc8f89f0d0d45b26e"] .section-background {background: linear-gradient(270deg, #DFCCBE 500px, #F8F5F2 80px);}


My question is, how do I add tablet parameters?

ie: @media screen and (max-width:1024px) and (min-width:768px)


I tried this, but of course - got an error

@media screen and (max-width:1024px) and (min-width:768px)
.section-background {background-color: #DFCCBE;}


Site: https://star-fennel-h9p3.squarespace.com/

Password: website2021

Link to comment
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic


You're incredibly close with the code you shared to having a working solution. The reason it isn't working is because there are no opening and closing "{}" following the code for your @media screen query, so the fix is simple.

@media screen and (max-width:1024px) and (min-width:768px) {
.section-background {background-color: #DFCCBE;}} 

Hope this helps!



Link to comment
11 hours ago, LaurelB said:

Thanks @Wolfsilon!  But for some reason it still didn't work to change the background to a single color!

Any ideas?

I tried adding !important;  but still nothing!


Hi. Where is this section on homepage?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.