Last active
October 19, 2018 11:54
-
-
Save DanLaufer/79f2a9bde9d305b77a825aea627ace27 to your computer and use it in GitHub Desktop.
Responsive YouTube Videos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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