Created
April 10, 2014 08:23
-
-
Save randylien/10355872 to your computer and use it in GitHub Desktop.
Constant aspect ratio
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 style="width: 100%; position: relative; padding-bottom: 20%;"> | |
<div style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; border: 1px solid #ccc;"> | |
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