Created
March 16, 2019 18:58
-
-
Save sicdigital/a09f1cd652e0ed6c27244f73917c4f17 to your computer and use it in GitHub Desktop.
Sass for implementing image placeholders of different aspect ratios
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
.image-loading-container { | |
display: block; | |
position: relative; | |
height: 0; | |
.image-container{ | |
padding-bottom: 100%; | |
img { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment