Created
May 28, 2014 22:09
-
-
Save elikem/33f9d863e76cab8bc24e to your computer and use it in GitHub Desktop.
Maintain Aspect Ratio with CSS
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 style="width: 100%; position: relative; padding-bottom: 20%;"> | |
| <div style="position: absolute; left: 0; top: 0; right: 0; bottom: 0;"> | |
| this content will have a constant aspect ratio that varies based on the width. | |
| </div> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment