Skip to content

Instantly share code, notes, and snippets.

@marciobarrios
Created March 20, 2013 12:20
Show Gist options
  • Save marciobarrios/5204250 to your computer and use it in GitHub Desktop.
Save marciobarrios/5204250 to your computer and use it in GitHub Desktop.
Vertical align .b inside .c
/* Vertical align .b inside .c */
/* Default */
body { font: 14px/20px sans-serif; }
.c { width: 300px; height: 300px; background: #eee; margin: 20px auto; text-align: center; }
.e { width: 200px; background: #ffc; }
/* Align .e (element) in the middle of .c (container) */
<div class=c>
<div class=e>I want to stay center aligned!</div>
</div>
// alert('Hello world!');
{"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