Last active
June 17, 2020 12:24
-
-
Save wklsh/50b481ae312600f061dc85b14e6eb776 to your computer and use it in GitHub Desktop.
Reponsive square CSS elements – Revised
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
.squareWrapper { | |
width: 50%; | |
display: inline-block; // Ensure that element is `inline-block` | |
&:before { // Ensure that pseudo-before element does not have any WIDTH property | |
content: ""; | |
display: block; | |
padding-bottom: 100%; | |
float: left; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment