Jump to content

How to have a different video background on mobile ?

Go to solution Solved by Lesum,

Recommended Posts

Hi everyone !

Haven't found exactly what I'm looking for yet, so I figured I would ask here.

I made a promotional video for my company that I set as a background on the website's main page. However, I also made a vertical version of the same video to post on Tiktok and Instagram, and I would like to have it as the mobile background. 

This is my website : https://rtfxcreative.com (It's in french)

This is the original video : https://youtu.be/dSLlPzs87MY

And this is the vertical one for mobile : https://youtube.com/shorts/Kd9T37ntvIs

Ideally I would like to have them both directly hosted on the website instead of relying on YouTube links. Is there a way to do that ?

Thanks in advance for your help !

 

Edited by timrocheleau
Link to comment

@timrocheleau You have the option to create a section with the vertical video background just below the background video section for desktop view. With custom CSS code, we can ensure that the section with vertical video background is visible only on mobile devices. Once you've created this section, I can provide you with the necessary code.

Additionally, you can download and upload the YouTube video on Squarespace and use it as a background. Thank you.

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment
  • Solution

@timrocheleau Here's the code snippet to display the second section you just added only on mobile view:

section[data-section-id="64ef64b0faeb714170c9687c"] {
	display: none !important;
}

@media only screen and (max-width: 767px) {
	section[data-section-id="64ef64b0faeb714170c9687c"] {
		display: block !important;
	}
	section[data-section-id="6465756225992a307c3806fe"] {
		display: none !important;
	}
}

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

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.