Skip to content

Instantly share code, notes, and snippets.

@DanLaufer
Last active October 19, 2018 11:54
Show Gist options
  • Save DanLaufer/79f2a9bde9d305b77a825aea627ace27 to your computer and use it in GitHub Desktop.
Save DanLaufer/79f2a9bde9d305b77a825aea627ace27 to your computer and use it in GitHub Desktop.
Responsive YouTube Videos
<!-- https://www.ostraining.com/blog/coding/responsive-videos/ -->
<div class="video-responsive">
<iframe width="420" height="315" src="http://www.youtube.com/embed/6xisazZX9bA" frameborder="0" allowfullscreen></iframe>
</div>
<style>
.video-responsive{
overflow:hidden;
padding-bottom:56.25%;
position:relative;
height:0;
}
.video-responsive iframe{
left:0;
top:0;
height:100%;
width:100%;
position:absolute;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment