Skip to content

Instantly share code, notes, and snippets.

@locvfx
Created August 8, 2018 14:31
Show Gist options
  • Save locvfx/ff9c0ec68b5768f1a95b483325b20b93 to your computer and use it in GitHub Desktop.
Save locvfx/ff9c0ec68b5768f1a95b483325b20b93 to your computer and use it in GitHub Desktop.
How To Make a Responsive 100% Width YouTube iFrame Embed #HTML #CSS #youtube
.container {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%;
}
.video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
<div class="container">
<iframe src="//www.youtube.com/embed/yCOY82UdFrw"
frameborder="0" allowfullscreen class="video"></iframe>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment