Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/06/2012, 10:28
towi62
 
Fecha de Ingreso: abril-2005
Mensajes: 253
Antigüedad: 19 años
Puntos: 0
dar margenes a div

Necesito dar unos margenes a unos div para que esto me quede asi:



y mi codigo es este:


Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es-es">
  3. <title>Interferencias by Rafael</title>
  4.  
  5. <style type="text/css">
  6. #divPadre {
  7.     height:100px;
  8.     width:800px;
  9.     background-color:blue;
  10.         overflow: hidden;
  11.     position: absolute;
  12.     left: 50%;
  13.     top: 50%;
  14.     margin-top: -100px;
  15.     margin-left: -150px;
  16. }
  17.  
  18. #cajon1 {
  19.     float:left;
  20.     margin:0px auto;
  21. background:#CC6600;
  22. }
  23. #cajon3 {
  24.     clear:both;
  25.     margin:0px auto;
  26. background:#CC6600;
  27. }
  28.  
  29.  
  30. </head>
  31.     <body>
  32.         <div id="divPadre">
  33.         <div id="cajon1">
  34. DonMango
  35. </div>
  36. <div id="cajon3">
  37. Registro de usuarios
  38. </div>
  39.         </div>
  40.     </body>
  41. </html>


quiero hacer que los divs hijos queden centrado dentro del padre y el div donde dice registro de usuarios no tenga el mismo ancho que el div padre
Muchas gracias por regalarme un poco de su tiempo.
__________________
:cool: aprendiz :cool: