Vertically align text in a div

This is loosely taken from this page:

Here is the html structure:

<div class="container">
		Your content here.

Here’s the css:
Must have a height, be set to be a table and have the vertical-align set.

.container { height:75px; display: table; vertical-align:middle; }
.container p { display:table-cell; vertical-align: middle; }


Tags: ,

No comments yet.

Leave a Reply