Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lucasreppewelander/e7020805a2a1174e5c11dae377e9d2df to your computer and use it in GitHub Desktop.
Save lucasreppewelander/e7020805a2a1174e5c11dae377e9d2df to your computer and use it in GitHub Desktop.
16:9 css hack
.video-wrapper {
position: relative;
padding-bottom: 56.25%;
padding-top: 25px;
height: 0;
}
.video-wrapper video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
<div class="video-wrapper">
<video />
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment