Ver Mensaje Individual
  #5 (permalink)  
Antiguo 03/06/2008, 12:59
Andrecitop
 
Fecha de Ingreso: septiembre-2007
Mensajes: 7
Antigüedad: 16 años, 7 meses
Puntos: 0
Respuesta: Centrar dos divs

Cita:
Iniciado por ssclamp Ver Mensaje
Mira si esto te sirve. He coloreado los fondos de los divisores para ver mejor el efecto.

Código HTML:
<body>
<div id="caja_envolvente" style="position: absolute; width:600px; height:300px; margin-left: -300px; margin-top: -150px; z-index:1; left: 50%; top: 50%; background-color:#C0C0C0">
<div style="position: absolute; width: 400px; margin-left: -200px; left: 50%">
	<div id="primer_divisor" style="width: 200px; height: 200px; float:left; background-color:#FFFF00">Contenido 1</div>
	<div id="segundo_divisor" style="width: 200px; height: 200px; float:left; background-color:#FF0000">Contenido 2</div>
</div>
</div>
</body> 
También se puede centrar respecto a la altura.

Naturalmente los tamaños los debes adaptar a tu uso.

Saludos
Gracias brother..lo voy a probar