Skip to content

Instantly share code, notes, and snippets.

@justincron
Forked from jonsuh/js-video-basic.css
Created February 7, 2013 19:29
Show Gist options
  • Save justincron/4733470 to your computer and use it in GitHub Desktop.
Save justincron/4733470 to your computer and use it in GitHub Desktop.
.js-video {
height: 0;
padding-top: 25px;
padding-bottom: 67.5%;
margin-bottom: 10px;
position: relative;
overflow: hidden;
}
.js-video.widescreen {
padding-bottom: 57.25%;
}
.js-video.vimeo {
padding-top: 0;
}
<div class="js-video [vimeo, widescreen]">
[video html goes here]
</div>
.js-video embed, .js-video iframe, .js-video object, .js-video video {
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
}
<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