Last active
August 29, 2015 14:11
-
-
Save bjmiller121/2c9c674e20a9012f4fe8 to your computer and use it in GitHub Desktop.
Proportionate iframe resize
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
/* Proportionately resize iframes. Add class to a wrapper around the iframe */ | |
.iframe-4-3, | |
.iframe-16-9 { | |
position: relative; | |
padding-bottom: 75%; /* 4:3 */ | |
height: 0; | |
} | |
.iframe-4-3 iframe, | |
.iframe-16-9 iframe { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
} | |
.iframe-16-9 { | |
padding-bottom: 56.25%; /* 16:9 */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment