Jump to content

Hide gallery on mobile only

Recommended Posts

Yes, you can create one section for mobile and a section for desktop and hide the one that shouldn't be showing on desktop and mobile.  It's just a little bit of code.

First, create your section that you want on the desktop and then add a new section for your mobile view.

 

//VARIABLES//

@mobile: ~"only screen and (max-width: 640px)";

@desktop: ~"only screen and (min-width: 760px)";

 

//hide mobile section on desktop//

@media @mobile {section[data-section-id="61a03d7xxxxxxxxxxxx"]{display:none!important;}}

//hide desktop section on mobile//

@media @desktop {section[data-section-id="61a03dxxxxxxxxxxxx"]{display:none!important;}}

Edited by Donna_Vincent
Link to comment

Thank

13 hours ago, Donna_Vincent said:

Yes, you can create one section for mobile and a section for desktop and hide the one that shouldn't be showing on desktop and mobile.  It's just a little bit of code.

First, create your section that you want on the desktop and then add a new section for your mobile view.

 

//VARIABLES//

@mobile: ~"only screen and (max-width: 640px)";

@desktop: ~"only screen and (min-width: 760px)";

 

//hide mobile section on desktop//

@media @mobile {section[data-section-id="61a03d7xxxxxxxxxxxx"]{display:none!important;}}

//hide desktop section on mobile//

@media @desktop {section[data-section-id="61a03dxxxxxxxxxxxx"]{display:none!important;}}

Thank you this has worked

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.