Skip to content

Instantly share code, notes, and snippets.

@xiel
Created November 8, 2012 22:06
Show Gist options
  • Save xiel/4042039 to your computer and use it in GitHub Desktop.
Save xiel/4042039 to your computer and use it in GitHub Desktop.
Centered Element by xiel
/**
* Centered Element by xiel
*/
body{
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
.centered {
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
margin: auto;
max-width: 200px;
max-height: 200px;
background: #fff;
}
<div class="centered">
<h1>i am so self centered</h1>
</div>
{"view":"separate","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