Jump to content

Code for adding alternate banner image on mobile

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi @KingdomCreativeCo

 

I see you have Index Collection as homepage and It has Introduction as the first section. 

Just add another section below Introduction. This would be for mobile add image that you built for mobile version.

And then add this in Custom CSS:

@media(min-width: 768px) {
    .homepage .Index section:nth-child(2) {
        display: none;
    }
}

@media(max-width: 767px) {
    .homepage .Index section:first-child {
        display: none;
    }
}

This css will hide the first section on mobile version and the newly added second section on the desktop version.

 

Let me know if you have any confusion.

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.