Podés copiar lo siguiente en una página en blanco y ver el ejemplo:
<head>
<title>Página de prueba con layer centrado horizontal y verticalmente</title>
<style type="text/css">
html, body { background-color: #FFFFFF; height: 100%; margin: 0; padding: 0;
color: white; text-align: center; }
div#centered { border: 0; background-color: #00FF00; height: 50%; width: 50%;
position: absolute; left: 25%; top: 25%; color: black; }
</style>
</head>
<body>
<div id="centered">
<p>Div centrado vertical y horizontalmente, cambiando el valor top de 25% a
0% sólo queda centrado verticalemente.</p>
</div>
</body>
Espero te sea útil, suerte!