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
.wrapper-class { | |
display: block; | |
position: relative; | |
overflow: hidden; | |
height: 0; | |
// Give parent container a percentile padding to top, to reserve place of image. | |
// Then just position the child element (image) absolute. | |
// height px / width px * 100 = ratio in % | |
// e.g: 536 / 1024 * 100 = 52,344% |