Last active
September 25, 2021 21:23
-
-
Save MitsuhaKitsune/29ebc1d675b9de0c0045bfd8672bb079 to your computer and use it in GitHub Desktop.
Multiple ways to center horizontal/vertical content on div with CSS
This file contains hidden or 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
div { | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
height: 100vh; | |
margin: 0 auto | |
} | |
div { | |
display: grid; | |
place-items: center; | |
} | |
div { | |
position: absolute; | |
inset: 0; | |
margin: auto; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment