Skip to content

Instantly share code, notes, and snippets.

@moodoki
Last active February 21, 2021 09:31
Show Gist options
  • Save moodoki/4d10d53a03738e9db770fb7e8cf59197 to your computer and use it in GitHub Desktop.
Save moodoki/4d10d53a03738e9db770fb7e8cf59197 to your computer and use it in GitHub Desktop.
Automatically resizing iframe youtube embed
<div>
<div style="position:relative;padding-top:56.25%">
<iframe src="<youtube-embed-url-here" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment