Skip to content

Instantly share code, notes, and snippets.

@Hyperparticle
Created October 22, 2017 22:31
Show Gist options
  • Save Hyperparticle/25f0d2399a48f7b018906769a19013bb to your computer and use it in GitHub Desktop.
Save Hyperparticle/25f0d2399a48f7b018906769a19013bb to your computer and use it in GitHub Desktop.
How to make a rounded, responsive iframe (resizes dynamically)
.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%;
}
<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