spencer-f
1/23/2012 - 9:31 PM

Responsive Video Embeds

Responsive Video Embeds

To ensure that your video embeds respond to changes in browser 
size and scale, wrap your video embed code with the following 
division class:

<div class="video-container">

<iframe src="YOUR VIDEO EMBED CODE HERE"></iframe>

</div>


Then, in your style sheet, add the following css:

.video-container {
	position: relative;
	padding-bottom: 56.25%;
	padding-top: 0px;
	height: 0;
	overflow: hidden;
}

.video-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}