Last active
January 23, 2019 03:40
-
-
Save d3chapma/3860e959e0ad7aaedcb3c39f34c97695 to your computer and use it in GitHub Desktop.
Fix iFrames on tochunting.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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