I've got some questions about CSS text alignment that I am having some difficulty understanding. The best resource I've found about vertically aligning text via CSS is this: http://blog.themeforest.net/tutorials/vertical-centering-with-css/
I have a fiddle demonstrating some ways to vertically align text, and I'd appreciate if someone gave a quick answer.
I am curious why this text is not bottom aligned in container2's child, and have 5 quick questions in the JSfiddle.
HTML:
<div class="container container2">
container2
<div class="parent">
parent
<span class="child">
child<br/>
child
</span>
</div>
</div>
CSS:
.parent {
border: 1px solid green;
height: 50%;
}
.child {
border: 1px solid red;
vertical-align: bottom;
}
.container {
border: 1px solid black;
height: 150px;
margin-bottom: 40px;
}
.container1 .parent, .container2 .parent {
display: table;
}
.container1 .child, .container2 .child {
display: table-cell;
}
.container2 {
position: relative;
}
.container2 .parent {
width: 100%;
}
.container2 .child {
position: absolute;
right: 0;
top: 0;
bottom: 0;
}