Last active
June 8, 2019 17:06
-
-
Save jonsuh/3026455 to your computer and use it in GitHub Desktop.
Responsive YouTube, Vimeo, Embed, and HTML5 Videos with CSS Usage
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
.js-video { | |
height: 0; | |
padding-top: 25px; | |
padding-bottom: 67.5%; | |
margin-bottom: 10px; | |
position: relative; | |
overflow: hidden; | |
} | |
.js-video.widescreen { | |
padding-bottom: 56.34%; | |
} | |
.js-video.vimeo { | |
padding-top: 0; | |
} |
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="js-video [vimeo, widescreen]"> | |
[video html goes here] | |
</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
.js-video embed, .js-video iframe, .js-video object, .js-video video { | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
} |
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="js-video [vimeo, widescreen]"> | |
<iframe width="560" height="315" src="http://www.youtube.com/embed/wN3gueLT0D8?showinfo=0" frameborder="0" allowfullscreen></iframe> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok