Ver Mensaje Individual
  #10 (permalink)  
Antiguo 26/02/2009, 07:10
Olivier
 
Fecha de Ingreso: enero-2008
Mensajes: 36
Antigüedad: 16 años, 3 meses
Puntos: 0
Respuesta: Centrado vertical, caso muy concreto [Expertos] Ayuda-Help

Aqui lo teneis (he tenido que separar la url del doctype, maldito filtro anti-spam)


Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "h ttp://w ww.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Prueba</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style type="text/css">
html, body { margin:0; padding:0;
height: 100%;
text-align: center;

}
#marco {
margin: auto;
display: table;
height: 100%;
width:100%;
}
#contenedor {
margin: auto;
display: table-cell;
vertical-align: middle;
position: relative;
height: 100%;
text-align:center;
}
#vertical_ie { width:0;
height:100%;
display:inline-block;
vertical-align:middle;
margin-bottom:-60px;

}
#centrador {
display:inline-block;
vertical-align:middle;
}
#amarillo {
height:40px;
background-color:yellow;
}
#verde {
height:20px;
background-color:green;
}
#central {
background-color:blue;
width:100%;
color:#ffffff;
}
</style>


</head>
<body>

<div id="marco">
<div id="contenedor">
<div id="amarillo"></div>


<span id="vertical_ie"></span>
<span id="centrador">
	<div id="central">Podeis probar a llenar el hueco con la altura que querais</div>
</span>

<div id="verde"></div>

</div>
</div>
</body>
</html>