Skip to content

Instantly share code, notes, and snippets.

@d3chapma
Last active January 23, 2019 03:40
Show Gist options
  • Save d3chapma/3860e959e0ad7aaedcb3c39f34c97695 to your computer and use it in GitHub Desktop.
Save d3chapma/3860e959e0ad7aaedcb3c39f34c97695 to your computer and use it in GitHub Desktop.
Fix iFrames on tochunting.com
// Anywhere that you have a video there will be an iframe tag
// You need to wrap the iframe tag in a div tag with a class of `video-container`
// You also need to remove the height and width attributes on the iframe tag
<div class='video-container'>
<iframe> // Keep the iframe tag and its contents as is, except you want to remove the width and height attributes
</div>
// Then you need to add some css in your main.css file
.video-container {
position: relative;
overflow: hidden;
padding-top: 56.25%;
}
.video-container iframe {
position: absolute;
left: 0;
width: 100%;
top: 0;
height: 100%
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment