Created
April 23, 2013 10:40
-
-
Save deadlyhifi/5442553 to your computer and use it in GitHub Desktop.
Responsive iframe width and height hack using an image to maintain the aspect ratio. Thanks to http://jsfiddle.net/Masau/7WRHM/
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
.map { | |
position: relative; | |
min-height: 200px; | |
.ratio { | |
display: block; | |
width: 100%; | |
height: auto; | |
} | |
iframe { | |
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="col"> | |
<div class="map"> | |
<img class="ratio" src="inc/img/16x9.gif"/> | |
<iframe frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment