RESUELTO:
Ejemplo para gente que le interesa:
http://www.csslab.cl/2007/01/12/cent...tical-con-css/
| |||
| Centrado vertical. Última edición por maurozone; 27/01/2007 a las 20:53 |
| |||
| Re: Centrado vertical. Una forma fácil con CSS:
Código:
Fijate que tanto "margin-left" como "margin-top" son la mitad del ancho y alto respectivamente..centrado {
width: 100px;
height: 100px;
left: 50%;
top: 50%;
margin-left: -50px;
margin-top: -50px;
position: absolute;
}
Opción agregada: Otra forma de hacerlo es la siguiente:
Código:
Espero que lo entiendas, es un ejemplo sacado de la W3C. <style type="text/css">
/* Just some nice colors */
body {background: #363; color: #FF0; font-size: large;
text-shadow: black 0.2em 0.2em 0.2em}
/* Vertical centering: make div as large as viewport and use table layout */
div.container {top: 0; left: 0; width: 100%; height: 100%;
position: fixed; display: table}
p {display: table-cell; vertical-align: middle}
/* Also center the lines in the paragraph */
p {text-align: center}
</style>
<div class=container>
<p>This is vertically & horizontally centered.
</div>
Última edición por Syncime; 27/01/2007 a las 20:11 Razón: Agrego otra opción |