Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/03/2011, 05:09
Mikeliu
 
Fecha de Ingreso: enero-2011
Ubicación: Palma
Mensajes: 49
Antigüedad: 13 años, 3 meses
Puntos: 0
Respuesta: Doctype y tablas con divs

Código:
<html>
  <style>
    .total { width:100%; height:100% }
    
    .tab { display:table; margin:auto }
    .tab > div { display:table-cell; text-align:center; vertical-align:middle }
    /* estilos aplicados a los divs para comportarse como tablas. Es un estándar CSS pero, como suele pasar, no funciona en IE. */
    
    body { background-color:#006 }
    #cont { background-color:#066 }
  </style>
  <body class="tab total">
    <div id="menu"><!-- divs del menú --></div>
  	<div id="cont" class="total">
      <div><h1>Ejemplo de título</h1></div>
    </div>
  </body>
</html>
Probad con el Doctype de la versión 4.01:
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Y veréis que el div tabular se encoge.