Last active
December 10, 2015 05:46
-
-
Save RajaJaganathan/a8fe63cd291a1a06e517 to your computer and use it in GitHub Desktop.
Vertically/Horizontal center a content block:
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
(IE9+) | |
.center-horizontal { | |
position: relative; | |
left: 50%; | |
transform: translateX(-50%); | |
} | |
.center-vertical { | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); | |
} | |
.abs-center { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform:translate(-50%,-%50); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment