Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/08/2011, 23:34
Avatar de miros84
miros84
 
Fecha de Ingreso: diciembre-2008
Mensajes: 351
Antigüedad: 15 años, 4 meses
Puntos: 4
Problemas con float:left

Hola, Tengo 3 divs con position:relative;
Cuando en el div del medio le pongo otros 2 divs con floar left, el contenido de este div del medio, no se me queda en el medio, sino se va abajo del todo.
Dejo aqui el codigo para que lo veis:

Código:
<!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>Documento sin título</title>
<style type="text/css">

body, p{
	margin:0px;
	padding:0px;
}

#Container {
	position:relative;
	width:auto;

}

#headerw1 {
	position:relative;

	width:auto;
	margin:auto;
	height:auto;
	background-color:#363;

}

#headerw2 {
	position:relative;
	width:auto;
	margin:auto;
	height:auto;
	background-color:#553;
}

#headerw3{
	position:relative;

	width:auto;
	margin:auto;
	height:auto;
	background-color:#883;

}

	#contentcenter-left, #contentcenter-right{
		position:relative;
		width:392px;
		text-align:center;
 float:left;
	}
</style>
</head>

<body>

<div id="Container">

<div id="headerw1">11111111111</div>
<div id="headerw2"> 
  <p>22222 </p>
  <p>2</p>
  <p>2</p>
  <div id="contentcenter-left">
  
  <h2>test1</h2>
testtt111111111111
  
  </div>
  <div id="contentcenter-right"><h2>test2</h2>
  
testtttttt22222222222

  </div></div>
<div id="headerw3">3333333333333</div>

</div> <!-- Container -->
</body>
</html>
El unico problema es cuando añado esta linea: float:left;

Alguna sugerencia de porque no puedo utilizar float:left en este caso y como resolver el problema?