CSS Vertical Centering Made Easy
28.03.2011
In CSS Level 2, you won't find the vertical centering property . What to do.
But even in CSS2, you can center boxes vertically by combining a few properties. The trick is to specify that the outer box should be formatted like a table cell, because the contents of the cell should be centered vertically.
*div class="container"
style="height: 300px;
width:500px;
margin:0 auto;
display:table-cell;
vertical-align: middle;
border:1px dashed #999;
text-align:center;">
*p>Here is a small paragraph centered vertically</p*
</div*
Here is a small paragraph that is centered vertically in a box with a border. And even lower Bonus.

Bonus from me: - nice music
SUBSCRIBE TO NEWSLETTER
Last in our blog
Internet Marketing
04.11.2019
Internet Marketing
03.10.2019