Created
July 16, 2021 05:24
-
-
Save VehpuS/10758d3e08abfa8abe35d18b69725bd9 to your computer and use it in GitHub Desktop.
A quick reference to cool ways to center elements
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
.el { | |
position: absolute; | |
left: 50%; | |
transform: translateX(-50%); | |
top: 0; | |
transform: translateY(calc(50vh - 50%)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment