Skip to content

Instantly share code, notes, and snippets.

@bepatrickdavid
Created July 20, 2015 14:58
Show Gist options
  • Save bepatrickdavid/07cf8d8bdb536ac3206b to your computer and use it in GitHub Desktop.
Save bepatrickdavid/07cf8d8bdb536ac3206b to your computer and use it in GitHub Desktop.
CSS: center text div vertical and horizontal
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%,-50%);
-webkit-transform: translate(-50%,-50%);
-moz-transform: translate(-50%,-50%);
-o-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