Vertical Centering in CSS

From the blog:

Vertical Centering in CSS

Though there is a CSS property vertical-align, it doesn’t work like attribute valign in HTML tables. CSS property vertical-align doesn’t seem to be able to solve this problem:

  • there is an area (e.g. <div>) with known height in the page
  • an internal object (typically long text in <div>) is inside the area and I don’t know its height (e.g. because its content is dynamically generated from a database)
  • I want to center the object vertically within the area
  • without using HTML tables.

No general solution was known until yesterday. I have found it going home on Wilson street.


~ by WPA Staff on September 15, 2011.

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: