Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/11/2007, 11:38
Laufwerk
 
Fecha de Ingreso: marzo-2007
Mensajes: 538
Antigüedad: 17 años, 2 meses
Puntos: 0
Re: Alineacion vertical de DIVS

Gracias por tu atencion y posible ayuda.
tengo este codigo en el HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="estilos.css" rel="stylesheet" type="text/css" />
</head>
<div class="main">
<div class="header">&nbsp;</div>
<div class="content">&nbsp;</div>
<div class="footer">&nbsp;</div>
</div>
<body>
</body>
</html>

y en el CSS tengo:

.main{
position:absolute;
background-color:red;
width:100%;
}
.header{
clear:both;
background-color:blue;
position:relative;
float:left;
height:100px;
}
.content{
clear:both;
background-color:yellow;
position:relative;
float:left;
}
.footer{
clear:both;
background-color:lightgreen;
position:relative;
float:left;
height:50px;
}


Verás que el main se adapta verticalmente a lo que ocupe en su interior, o sea header, content y footer.

Si le pones al main un height:600px; podrás observar que los divs interiores ocupan lo mismo, pero a mi me gustaria que el div footer se pegara a la parte inferior del main, porque en mi pagina y en la mayoria el header y footer tienen un tamaño fijo, el content puede ir variando.


A ver si con esto te sirve.

Mil gracias por adelantado.