Simon Willison’s Weblog

Vertical centering with CSS

Lots of people said it couldn’t be done (myself included), but evidently we were wrong. Joe Gillespie shows how to achieve vertical centering with CSS in the latest edition of WPDFD. Via Craig Saila, who also has an experimental piece showing how the height of three divs can be set to the height of the tallest of the three, using javascript.

This is Vertical centering with CSS by Simon Willison, posted on 7th January 2003.

Next: Wiki hosts and ticket stubs

Previous: Using page titles properly

Previously hosted at