Created
August 6, 2014 05:06
-
-
Save potch/76db9b6d34740e69c5cb to your computer and use it in GitHub Desktop.
CSS Centering Yay!
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
.thing-to-center { | |
position: absolute; | |
left: 50%; /* or wherever you want the horizontal center */ | |
top: 50%; /* or wherever you want the vertical center */ | |
transform: translate(-50%,-50%); /* The Magic™ */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment