Created
May 11, 2016 07:38
-
-
Save mrcotter/43e81c24bb9214afbbef22e16e933dd7 to your computer and use it in GitHub Desktop.
Make iframe responsive
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
.myIframe { | |
position: relative; | |
padding-bottom: 56.25%; | |
padding-top: 30px; | |
margin-top: 30px; | |
margin-bottom: 30px; | |
height: 0; | |
overflow: auto; | |
-webkit-overflow-scrolling:touch; | |
} | |
.myIframe iframe { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
} |
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
<div class='myIframe' > | |
<iframe> </iframe> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment