Jump to content

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

Recommended Posts

Posted

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

Hey!

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)
[data-section-id="60b93ddcc8f89f0d0d45b26e"]
.section-background {background-color: #DFCCBE;}

 

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

Password: website2021

  • Replies 8
  • Views 1.4k
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Hello,

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) {
[data-section-id="60b93ddcc8f89f0d0d45b26e"]
.section-background {background-color: #DFCCBE;}} 

Hope this helps!

-Dan

 

  • 2 years later...
Posted

@tuanphan : I am trying to add a descriptor below a category one ONE shop page but am having alignment issues on both desktop and mobile. Can you please take a look at this for me? Thanks so much!

Screenshot 2024-06-17 at 12.00.21 PM.png

Posted

I am trying to add a descriptor below a category one ONE shop page but am having alignment issues on both desktop and mobile. Can you please take a look at this for me? Thanks so much! 

Screenshot 2024-06-17 at 12.00.21 PM.png

Posted
5 hours ago, twostudios said:

I am trying to add a descriptor below a category one ONE shop page but am having alignment issues on both desktop and mobile.

Please post the URL for a page on your site where we can see your issue. For us to see the URL you need to include the link in the content of your post. The URL field the forum software provides is not shown to us.

A link to the backend of the your site won’t work for us, i.e. a URL that contains /config/.

Please set up a site-wide password, if your site is not public and you've not already done so.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site.

Please read the site-wide password and how to share a link documentation to understand how they work.

You may find How to post a forum question post useful.

We can then take a look at your issue.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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.