Jump to content

Consistent Aspect Ratio for Background Video and Images

Recommended Posts

I have a background video that I want to maintain an anamorphic widescreen aspect ratio, regardless of the page scaling and for it to be consistent on desktop and mobile. I want this to function for both background videos and image, and to be site wide (but only for background image/videos, not galleries). I know how to make the change for a specific block, but I'm looking for custom CSS to do it across the site.

Link to comment
On 9/13/2024 at 3:49 AM, creaturellc said:

I have a background video that I want to maintain an anamorphic widescreen aspect ratio, regardless of the page scaling and for it to be consistent on desktop and mobile. I want this to function for both background videos and image, and to be site wide (but only for background image/videos, not galleries). I know how to make the change for a specific block, but I'm looking for custom CSS to do it across the site.

Let us know your site URL for the specific code, thanks

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - Lightbox captions only mode)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace
🚀 Learn how to rank new pages on Google in 48 hours!

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

Link to comment

Thanks for the response, @DediRock

Unfortunately, this didn't change anything. The background image is still scaling. I know I can edit the 56.25% value to change the aspect ratio, (which again, doesn't affect the page when I try it), but are the any other values here that I should be altering? Should this work as-is on my page, or do I need to modify things? And do I use both of those chunks of code or just one? What is each one doing?

Link to comment

Thanks! A few comments/questions:

1) I've applied both blocks (just copied and pasted, and the only thing I modified was the aspect ratio via the padding-bottom as you mentioned)

2) How do I know is the .background-media container is applied to the right element? Pardon my ignorance!

3) How do I know the CSS is applied correctly? The other elements of CSS I've added to the page are working right, so I assume this would too, what specifically should I be looking for?

 

Thanks again!

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.