Created
March 1, 2019 00:06
-
-
Save allanminium/f01c6f3c82f9981e81e963a44fc7cc5e to your computer and use it in GitHub Desktop.
[Vertical Align Image or Text] Vertical align images or text in CSS #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
| .container { | |
| position: relative; | |
| } | |
| .container .element { | |
| position: absolute; | |
| left: 50%; | |
| top: 50%; | |
| transform: translate(-50%, -50%); | |
| } | |
| /* https://stackoverflow.com/questions/10008670/vertical-align-image-in-div */ | |
| /* https://jsfiddle.net/Cthulhu/1xjbhsr4/ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment