Last active
March 10, 2022 17:53
-
-
Save someguy9/22f117e1d6783ac8dfd5eaccf77b0a07 to your computer and use it in GitHub Desktop.
This CSS lets you wrap an iframe with a div using the class 'responsive-embed-container embed-responsive-16by9' to make it 16:9 responsive
This file contains hidden or 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
.responsive-embed-container { | |
position: relative; | |
display: block; | |
overflow: hidden; | |
height: 0; | |
max-width: 100% !important; | |
} | |
.embed-responsive-16by9 { | |
padding-bottom: 56.25%; | |
aspect-ratio: 16 / 9; | |
} | |
.responsive-embed-container iframe, .responsive-embed-container object, .responsive-embed-container embed { | |
position: absolute; | |
left: 0; | |
top: 0; | |
height: 100%; | |
width: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment