Skip to content

Instantly share code, notes, and snippets.

@SiGaCode
Created June 26, 2014 17:35
Show Gist options
  • Save SiGaCode/79c90ecd07b489044eb4 to your computer and use it in GitHub Desktop.
Save SiGaCode/79c90ecd07b489044eb4 to your computer and use it in GitHub Desktop.
Responsive iframes and maps with just CSS
/* Responsive iFrame */
.responsive-iframe-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}
.responsive-iframe-container iframe,
.vresponsive-iframe-container object,
.vresponsive-iframe-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/*And then wrap your Google Map or Google Calendar iframe in a div like this:*/
/*<div class="responsive-iframe-container">
<... iframe code >
</div>*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment