Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/09/2008, 16:41
Avatar de salbatore
salbatore
 
Fecha de Ingreso: abril-2007
Ubicación: Springfield
Mensajes: 1.567
Antigüedad: 16 años, 11 meses
Puntos: 19
Centrar conjunto de div's - Complejo

Hola, foreros:

Tengo un conjunto de div's que estan con float left dentro de un div que centra el conjunto de div's en el centro horizontal del navegador. Funciona bien en Safari, pero en Firefox e Internet Explorer 6 no, ya que no centra el conjunto de div's en el centro sino que pega todos los elementos en la derecha de la web.

El problema es que no puedo dar una anchura al 'contenedor', ya que su contenido es dinamico. ¿Que puedo hacer para cetrar horizontalmente el contenido de 'contenedor' y continuen estando los tres div inline con su contenido flotando a la derecha?

Código HTML:
<div id='contenedor'  style="margin:0 auto 0 auto; text-align:center">
	<div style="width:4px;display:compact; float:left; overflow: hidden;">
		<div style="float:left;width:4px; height:4px; overflow:hidden;"></div>
		<div style="float:left;width:4px; display:block;white-space:pre !important; white-space:normal;"> </div>
		<div style="float:left;width:4px; height:4px; overflow:hidden;"></div>
	</div>							
							
	<div style="display:compact; float:left;  padding-top:4px;">
		<div style="padding-bottom:4px; float:left;">
			<div style=" float:left;">Search</div>
		</div>
	</div>	
	
	<<div style="width:4px;display:compact; float:left; overflow: hidden;">
		<div style="float:left;width:4px; height:4px; overflow:hidden;"></div>
		<div style="float:left;width:4px; display:block;white-space:pre !important; white-space:normal;"> </div>
		<div style="float:left;width:4px; height:4px;  overflow:hidden;"></div>
	</div>							
</div>