Skip to content

Instantly share code, notes, and snippets.

@iamstarkov
Created June 5, 2012 04:39
Show Gist options
  • Save iamstarkov/2872671 to your computer and use it in GitHub Desktop.
Save iamstarkov/2872671 to your computer and use it in GitHub Desktop.
centering with absolute position
/**
* centering with absolute position
*/
div {
width: 100px;
height: 100px;
background-color: red;
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment