Created
February 16, 2018 07:19
-
-
Save SarathSantoshDamaraju/95c5c33696878a561bb1a64e65974a8b to your computer and use it in GitHub Desktop.
CSS-- Vertically and Horizontally centre align Text to the Whole Page
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
/* | |
<body> | |
<p>Hello world</p> | |
</body> | |
*/ | |
p{ | |
margin: 0; | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
margin-right: -50%; | |
transform: translate(-50%, -50%) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment