Layout with CSS has never been as obvious as you would expect. Centering text inside a
div is straight forward with the
text-align property, but it starts to get tricky with internal boxes and floating. When you want to vertically center items, CSS, and some of its proponents, appear to stand directly against you.
Now there is another option, Physics-based Page Layout (Github, Blog). If you are trying to center with CSS, just give up and use physics. (Currently, it does not handle resizing the window. But, that is on the list.)