Created
March 16, 2015 03:44
-
-
Save harisrozak/276eaa03a632cb2abc37 to your computer and use it in GitHub Desktop.
CSS :: Another way to centering element
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
.absolute-centering { | |
width: 200px; | |
height: 150px; | |
position: absolute; /* or fixed */ | |
left: 50%; | |
margin-left: -100px; /* half of width */ | |
top: 50%; | |
margin-top: -75px; /* half of height */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment