Skip to content

Instantly share code, notes, and snippets.

@chrisgeo
Forked from anonymous/dabblet.css
Created May 16, 2012 20:46
Show Gist options
  • Save chrisgeo/2713816 to your computer and use it in GitHub Desktop.
Save chrisgeo/2713816 to your computer and use it in GitHub Desktop.
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
}
@font-face{
font-family:Myriad Pro;
font-weight:normal;
src: url(http://images.techtree.com/ttphase3/images/font/MyriadPro-Regular.eot);
src: url(http://images.techtree.com/ttphase3/images/font/MyriadPro-Regular.ttf) format(“truetype”);
}
body, div, form, input, li, ol, p, select, td, textarea, tr, ul, a {
font-family: Myriad Pro;
font-size:12px;
line-height:19px;
color:#666666;
}
div {
/* Make it pretty */
background: slategray;
text-align: center;
border-radius: .3em;
color: #405060;
text-shadow: 0 2px 1px hsla(0,0%,100%,.2);
line-height: 15px;
font-size: 10px;
padding: 10px
}
<div><h1>
Some text that looks funky maybe
</h1></div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment