Instantly share code, notes, and snippets.

Embed
What would you like to do?
Correct aspect ratio for images
&__image {
position: relative;
display: flex;
justify-content: center;
a {
width: 100%;
height: 0;
padding-bottom: 95%;
}
img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment