Created
March 11, 2015 21:31
-
-
Save a-double/64686f2c37a36659811f to your computer and use it in GitHub Desktop.
Flexible media embeds
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
| /* https://github.com/suitcss/components-flex-embed/blob/master/lib/flex-embed.css */ | |
| .flex-embed { | |
| display: block; | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .flex-embed-inner { | |
| display: block; | |
| width: 100%; | |
| padding-bottom: 56.26%; /* or whatever ratio, this is 16x9 */ | |
| } | |
| .flex-embed iframe, .flex-embed object, .flex-embed embed { | |
| position: absolute; | |
| top: 0; | |
| bottom: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| } |
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
| <div class="flex-embed"> | |
| <div class="flex-embed-inner"></div> | |
| <!-- iframe, embed, object, etc. --> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment