Created
October 22, 2017 22:31
-
-
Save Hyperparticle/25f0d2399a48f7b018906769a19013bb to your computer and use it in GitHub Desktop.
How to make a rounded, responsive iframe (resizes dynamically)
This file contains 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
.rounded { | |
position: relative; | |
border-radius: 10px; /* Rounded corners */ | |
padding-bottom: 62.5%; /* 16:10 ratio */ | |
height: 0; | |
overflow: hidden; | |
} | |
.rounded .frame { | |
position: absolute; | |
top:0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
} |
This file contains 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="rounded"> | |
<iframe class="frame" src="iframe url..." scrolling="no" frameborder="0"></iframe> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment