Last active
December 22, 2022 13:07
-
-
Save Minobi/3dab5b925f48490d9a3bfd6c8b13503d to your computer and use it in GitHub Desktop.
Square div block with height equal to width
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
.outer { | |
position: relative; | |
} | |
.outer:before { | |
content: ""; | |
display: block; | |
padding-top: 100%; | |
} | |
.inner { | |
position: absolute; | |
top: 0; | |
left: 0; | |
bottom: 0; | |
right: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment