Jump to content

[Share] Hide a Section on Desktop/Tablet/Mobile

Recommended Posts

Posted

To hide a specific section on Desktop or Tablet or Mobile, you can follow these steps.

#1. Install Squarespace ID Finder to find the ID of the Section you want to hide.

Quote

In my example, we have:

section[data-section-id="666a4ae7e23e2617b7e6f4ed"]

image.png.fa766a8bd7295942dba8b42bbda65740.png

#2. Use this code to hide section on Desktop:

/* Hide section on Desktop */
@media screen and (min-width:992px) {
    section[data-section-id="666a4ae7e23e2617b7e6f4ed"] {
  display: none !important;
  }
}

image.png.0fa80969b6c8a03b76a098e382b4e03e.png

#3. Use this code to hide section on Tablet:

/* Hide section on tablet */
@media screen and (max-width:991px) and (min-width:768px) {
section[data-section-id="666a4ae7e23e2617b7e6f4ed"] {
  display: none !important;
  }
}

image.png.3e91a7d9667f3ede0c7d9570215c905f.png

#4. Use this code to hide section on Mobile:

/* Hide section on mobile */
@media screen and (max-width:767px) {
section[data-section-id="666a4ae7e23e2617b7e6f4ed"] {
  display: none !important;
  }
}

image.png.3c3045efbf749000af9d19218372ab4e.png

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 2 weeks later...
  • Replies 2
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posted
On 6/27/2024 at 11:58 PM, rio1570047830 said:

I hide the galley slider simple in my mobile view and show Ed the strips. However, the headbar is overlapped with the gallery

https://www.yehlinlee.com/undercurrent

Screenshot_20240628-005441.png

By default, section has a top padding, but some gallery section doesn't have this.

You can use this code to Custom CSS to fix problem

@media screen and (max-width:767px) {
body#collection-667293cd507c183e79787dfa section[data-section-id="667ccb3e5e14a63c2e14072c"] {
    padding-top: 70px !important;
}}

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.