Jump to content

Different Desktop & mobile views

Recommended Posts

If you want this, you can use this CSS

/* new section background mobile */
@media screen and (max-width:767px) {
	[data-section-id="enter section id here"] {
		background-image: url(https://cdn.pixabay.com/photo/2015/07/09/23/09/cadaques-838724__340.jpg);
		background-size: cover;
		background-repeat: no-repeat;
}
}

Use this tool to find data section id. https://chrome.google.com/webstore/detail/squarespace-id-finder/igjamfnifnkmecjidfbdipieoaeghcff?hl=en

(This code for SS 7.1. With 7.0, you need to share site url)

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!)

Link to comment

If it helps, I've found the easiest way is to add 2 sections and hide one on desktop and one on mobile:

/*remove section on desktop only*/
@media screen and (min-width:780px) {
section[data-section-id="xxxxx"]{
    display: none !important;
}
}
/*remove section on mobile only*/
@media screen and (max-width:781px) {
section[data-section-id="xxxxx"] {
    display: none !important;
}
}

 

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.