Skip to content

Instantly share code, notes, and snippets.

@sicdigital
Created March 16, 2019 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sicdigital/a09f1cd652e0ed6c27244f73917c4f17 to your computer and use it in GitHub Desktop.
Save sicdigital/a09f1cd652e0ed6c27244f73917c4f17 to your computer and use it in GitHub Desktop.
Sass for implementing image placeholders of different aspect ratios
.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