Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/06/2009, 11:54
Avatar de Mikmoro
Mikmoro
Colaborador
 
Fecha de Ingreso: octubre-2006
Ubicación: K-pax
Mensajes: 7.228
Antigüedad: 17 años, 6 meses
Puntos: 280
Respuesta: centrado vertical con %



Prueba esto:
Cita:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es-es">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Centrado Vertical 5</title>
<style type="text/css">
html, body {height: 100%;
width: 100%;margin: 0;}
#caja {display: table;
height: 100%;
width: 100%;
position: relative;
}
.centrado {display: table-cell;
vertical-align: middle;
margin: 0 auto;
padding: 0 10px;
height: 100%;
}
.texto {position: relative;
top: 0;
display: block;
background-color: #f00;
color: #fff;
height: 30%;
}
</style>
</head>
<body>
<div id="caja">
<div class="centrado" style="*position: absolute;*top: 50%;*height: 30%">
<span class="texto" style="*top: -50%;*height: 100%">
Texto de prueba, más texto de prueba, otro texto de prueba y el último texto de prueba
</span>
</div>
</div>
</body>
</html>
(cómo me gustan los retos)

P.D.: sólo lo he mirado en IE6 y FF2.
__________________
Visita mi nueva web idplus.org