Vertical Centering in CSS
From the blog:
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.