It feels like it should be a simple task but it's easy to tie yourself in knots if you don't know any good tricks for vertical centering. Jake Archibald has two neat ways for vertically centering things in CSS.
Here's his method (opens in new tab) for modern browsers, as hosted on the collaborative code pastebin JsBin (opens in new tab):
And here's one (opens in new tab) that works for browsers going back to IE8:
You can follow some further discussion about these and other methods on Twitter, here (opens in new tab).
Liked this? Read these!
- Introduction to CSS selectors
- The ultimate guide to logo design (opens in new tab)
- Useful and inspiring flyer templates