Skip to content

Instantly share code, notes, and snippets.

@sr9yar
Created June 9, 2019 11:18
Show Gist options
  • Save sr9yar/b389f3e767dfcd5f47639559d3558d17 to your computer and use it in GitHub Desktop.
Save sr9yar/b389f3e767dfcd5f47639559d3558d17 to your computer and use it in GitHub Desktop.
Responsive youtube video
<style>
.video-wrapper
{
position: relative;
padding-bottom: 51.5%;
padding-top: 25px;
height: 0;
border-radius: 4px;
overflow: hidden;
}
.video-wrapper iframe
{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
<div class="video-wrapper">
<iframe
autoplay="true"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
src="https://www.youtube.com/embed/Q0oIoR9mLwc?autoplay=1&controls=1&mute=0&loop=1&playlist=Q0oIoR9mLwc&modestbranding=1"
frameborder="0"/>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment