1.top-align {
2 vertical-align: top;
3}
4
5.center-align {
6 vertical-align: middle;
7}
1/* CSS */
2div.outer {
3 display: table;
4}
5
6div.inner {
7 display: table-cell;
8 text-align: center;
9 vertical-align: middle;
10}
11
12/* HTML */
13<div class="outer">
14 <div class="inner">
15 lorem ipsum...
16 </div>
17</div>
18
19/*
20------------------------------------
21'vertical-align' values:
22 top | middle | bottom
23 text-top | text-bottom
24 super | baseline | sub
25 % | px
26*/