Jump to content

How do I replace background video with fallback image on mobile?

Recommended Posts

  • Replies 1
  • Views 361
  • Created
  • Last Reply
Posted

Use this code.... you are going to need a url for the image though. I just upload it to a company google drive.

Mobile Breakpoints

/* CSS FOR TABLET AND MOBILE */
@mobile:  ~"only screen and (max-width: 640px)";
@tablet:  ~"only screen and (min-width: 641px) and (max-width: 949px)";

/* CSS FOR TABLET */
@media @tablet {
/* Insert Code for Tablet Below This Line*/

/* Insert Code for Tablet Above This Line */
}

/* CSS FOR MOBILE */
@media @mobile {
/* Insert Code for Mobile Below This Line*/

/* Insert Code for Mobile Above This Line */
}

Mobile CSS

#PAGEURL img {
  display: none;
}

#PAGEURL .sqs-block-image img {
  display: block;
}

#PAGEURL {
  background: url('IMAGEURL');
  background-repeat: no-repeat;
  background-size: 100%;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.