Created
March 20, 2013 12:20
-
-
Save marciobarrios/5204250 to your computer and use it in GitHub Desktop.
Vertical align .b inside .c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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) */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class=c> | |
<div class=e>I want to stay center aligned!</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// alert('Hello world!'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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