Created
October 22, 2014 09:50
-
-
Save ayozebarrera/53ac50c9a37c99910891 to your computer and use it in GitHub Desktop.
How maintain 16:9 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
.ratio{ | |
display: block; | |
height: 0; /* we have padding-bottom instead height (content+padding-bottom)*/ | |
padding-bottom: 56.25%; /*16:9 ratio -> (9 ÷ 16) × 100 = 56.25 */ | |
overflow: hidden; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment