Created
March 31, 2015 07:34
-
-
Save keeprock/2892a0cceb18ed873cd2 to your computer and use it in GitHub Desktop.
Center percentage Width/Height elements https://css-tricks.com/centering-percentage-widthheight-elements/
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 { | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
-o-transform: translate(-50%, -50%); | |
-ms-transform: translate(-50%, -50%); | |
-webkit-transform: translate(-50%, -50%); | |
-moz-transform: translate(-50%, -50%); | |
transform: translate(-50%, -50%); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment