Jump to content

Change aspect ratio of video block in 7.1 desktop and mobile

Recommended Posts

Posted

Site URL: https://hawk-lavender-ne5l.squarespace.com/portfolio

Issue:

I'm working on the portfolio page where I have multiple sections of image blocks with the aspect ratio of their standard size of 2:3 (vertical). While this works for images and gifs, my client would like me to switch out the gif files for video files. I made my videos the same size as my images and uploaded a video block but squarespace does not support aspect ratios for video other than I believe 16:9. I found some custom css to plug in but it does not do the trick for the design of my page. This is the custom css I found —

.video-block .video-player{ padding-bottom:120% }

(I adjusted the percentage to get as close as I could to a 2:3 ratio which turned out to be 94%)

While this worked...somewhat....it also looks like it broke the code for my image blocks. Altering them to have a longer container so it wouldn't line up with the grid squares in comparison to the video block. Leaving the video block slightly higher/lower. Then it would not scale when switching over to mobile. 

 

Question:

Is there custom coding to help my portfolio page display videos in the same aspect ratio as my images and have them fit in perfectly on desktop and mobile?

https://hawk-lavender-ne5l.squarespace.com/portfolio

Password: cainsbitch

(sorry about the password, my dogs name is Cain lol) 

 

Here are some screenshots of how the videos display on desktop and mobile when I try the code above

Screenshot 2024-10-12 at 7.16.38 PM.png

Screenshot 2024-10-12 at 7.17.21 PM.png

Posted
5 hours ago, chels_acosta said:

Site URL: https://hawk-lavender-ne5l.squarespace.com/portfolio

Issue:

I'm working on the portfolio page where I have multiple sections of image blocks with the aspect ratio of their standard size of 2:3 (vertical). While this works for images and gifs, my client would like me to switch out the gif files for video files. I made my videos the same size as my images and uploaded a video block but squarespace does not support aspect ratios for video other than I believe 16:9. I found some custom css to plug in but it does not do the trick for the design of my page. This is the custom css I found —

.video-block .video-player{ padding-bottom:120% }

(I adjusted the percentage to get as close as I could to a 2:3 ratio which turned out to be 94%)

While this worked...somewhat....it also looks like it broke the code for my image blocks. Altering them to have a longer container so it wouldn't line up with the grid squares in comparison to the video block. Leaving the video block slightly higher/lower. Then it would not scale when switching over to mobile. 

 

Question:

Is there custom coding to help my portfolio page display videos in the same aspect ratio as my images and have them fit in perfectly on desktop and mobile?

https://hawk-lavender-ne5l.squarespace.com/portfolio

Password: cainsbitch

(sorry about the password, my dogs name is Cain lol) 

 

Here are some screenshots of how the videos display on desktop and mobile when I try the code above

Screenshot 2024-10-12 at 7.16.38 PM.png

Screenshot 2024-10-12 at 7.17.21 PM.png

You are mentioning the issue about the video spacing like so right?

image.thumb.png.9dca5b148c208efb8bca1d057c06667d.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

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.