Ver Mensaje Individual
  #5 (permalink)  
Antiguo 04/06/2011, 10:36
kseso?
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: Ajustar ancho y centrar DIV

Código CSS:
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" lang="es-es">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  5. <title>Kseso? Jugando con css</title>
  6. <style type="text/css">
  7.  * {
  8.     margin: 0;
  9.     padding: 0;
  10.     border: 0;
  11. }
  12. html, body {
  13.   height: 100%;
  14.   width:100%;
  15.   font-size: 100%;
  16. }
  17. html {display: table;}
  18. body {display: table-row;}
  19. #caja{
  20.  display:table-cell;
  21.  border:1px solid #444;
  22.  height:300px;
  23.  width:100%;
  24.  vertical-align:middle;
  25. }
  26. #caja p {
  27.  text-align:center;
  28.  font-size: 2em;
  29.  }
  30. </style>
  31. </head>
  32. <body>
  33. <div id="caja">
  34.   <p>El campo nombre no ha sido rellenado correctamente</p>
  35.   <p>El campo contraseña no ha sido rellenado correctamente</p>
  36. </div>
  37. </body>
  38. </html>