Jump to content

Embedded Responsive Youtube Video Sizing issues

Recommended Posts

Posted

I am embedding youtube video playlists onto my website. They are stacked on top of each other. I added some code to make them responsive in mobile and that worked fine. However, on mobile each successive playlist as you go down appears smaller than the one before it. If I reorganize the order of the playlists they change sizes always so that they get smaller as they go down the page. I used the same embed code for all of them just replacing the video source and based on my limited understanding of embed code I feel like the playlists should all be the same size since they are all given the same parameters to interact with the same "container." The code I used is below. I also included a screenshot of the issue on mobile. Can anyone help?

<div class="iframe-container"> <style>
.iframe-container{
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; 
  height: 0;
}
.iframe-container iframe{
  position: absolute;
  top:0;
  left: 0;
  width: 100%;
  height: 100%;
}
</style> <iframe width="560" height="315" src="videowebaddress" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

IMG_0305.jpg

  • 2 years later...
  • Replies 2
  • Views 1.5k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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.