Currently, I have a page with an embedded YouTube video that is intended to be placed in a container with a variable width. When the video is outside of the container, the aspect ratio appears normal. However, once it is placed inside the container, the height of the video stretches beyond what would typically be considered a standard aspect ratio (Refer to the screenshot).
Below is the relevant code snippet:
.video-container {
display: block;
float: left;
width: 74.05rem;
margin-left: 1.1rem;
margin-right: 1.1rem;
margin-right: 0;
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0; }
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%; }
I consulted this article for guidance, so if there is a more effective approach, please feel free to share! http://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php
If you'd like to see this in action, visit