Skip to content

Instantly share code, notes, and snippets.

@harisrozak
Last active November 24, 2016 01:29
Show Gist options
  • Save harisrozak/d0cfee9a392def5e23cdd9c7c577832e to your computer and use it in GitHub Desktop.
Save harisrozak/d0cfee9a392def5e23cdd9c7c577832e to your computer and use it in GitHub Desktop.
Fluid youtube or iframe videos
<style type="text/css">
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
<div class="videoWrapper">
<!-- Copy & Pasted from YouTube -->
<iframe width="560" height="349" src="https://www.youtube.com/embed/e5iCqzKZLLY" frameborder="0" allowfullscreen></iframe>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment