A Pen by Petrus Rex on CodePen.
Created
November 9, 2015 05:11
-
-
Save gothburz/a12a7733664c75b1cf39 to your computer and use it in GitHub Desktop.
Center Anything in the Dead Center of the Page Always!
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
<h1 class="center">A Super Sexy Header Tag<h1> |
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
.center{ | |
position: fixed; | |
top: 50%; | |
left: 50%; | |
/* bring your own prefixes */ | |
transform: translate(-50%, -50%); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment