CSS vertical centering using display: table and display: table-cell.

Sometime the div with display: table doesn’t stretch to the full height of the containing div. It is probably because the position for that div was set as position: absolute. To overcome this limitation, wrap that div with an outer div with position: absolute and make this div’s position: static. That will stretch display: table div element of the height of the parent div.

More on that here: http://stackoverflow.com/questions/396145/how-to-vertically-center-a-div-for-all-browsers


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: