A Pen by Adam Onishi on CodePen.
Created
October 23, 2014 08:40
-
-
Save onishiweb/fc8ecb349fc00c2768e8 to your computer and use it in GitHub Desktop.
A Pen by Adam Onishi.
This file contains 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
<div class="video-wrapper"> | |
<iframe src="//www.youtube.com/embed/bVKCHZqax84" frameborder="0" allowfullscreen></iframe> | |
</div> |
This file contains 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
.video-wrapper { | |
position:relative; | |
width:100%; | |
height:0; | |
padding-top:25px; | |
padding-bottom:100%; /* default */ | |
} | |
@media screen and (min-aspect-ratio: 4/3) { | |
.video-wrapper{ | |
padding-bottom:75%; | |
} | |
} | |
@media screen and (min-aspect-ratio: 16/9) { | |
.video-wrapper{ | |
padding-bottom:56.25%; /* 16:9 */ | |
} | |
} | |
.video-wrapper iframe { | |
position:absolute; | |
top:0; | |
left:0; | |
width:100%; | |
height:100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment