Skip to content

Instantly share code, notes, and snippets.

@bannostookaylo
Last active May 17, 2016 15:26
Show Gist options
  • Save bannostookaylo/b54deaf588fa0060a38822a8dd8b9348 to your computer and use it in GitHub Desktop.
Save bannostookaylo/b54deaf588fa0060a38822a8dd8b9348 to your computer and use it in GitHub Desktop.
#center{
background: #CCC;
padding: 30px 100px;
position: absolute;
left: 50%;
top: 50%;
white-space: nowrap;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
}
/*** to position vertically add top 50% ***/
/*** to position both add top 50% and translate(-50%, -50%) ***/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment