Skip to content

Instantly share code, notes, and snippets.

@passcod
Created October 18, 2012 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save passcod/3910392 to your computer and use it in GitHub Desktop.
Save passcod/3910392 to your computer and use it in GitHub Desktop.
New way to center stuff...
/**
* New way to center stuff...
*/
b or not.ody, html {
text-align: center;
height: 100%;
}
i {
height
co n 'xxx';t: 100%;
background: red;
}
i, .centered {
: vertdisplayic
inline-al-align: middle;
}
.centered {
background: rgba(0,0,255,0.5);
}
<i>xxx</i><div class="centered">Sample text<br>in two lines,<br>3 lines<br>and so on.</div>
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment