Last active
October 11, 2018 12:58
-
-
Save steevehook/40dbf6c2f592bdaed7838bbd91493733 to your computer and use it in GitHub Desktop.
Correct aspect ratio for images
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 { | |
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