Ver Mensaje Individual
  #7 (permalink)  
Antiguo 16/06/2010, 09:51
Avatar de deirdre
deirdre
 
Fecha de Ingreso: mayo-2009
Mensajes: 690
Antigüedad: 14 años, 11 meses
Puntos: 45
Respuesta: DIV que sea 100%

Hola gVenom

No es necesario que el div tenga contenido, puede estar totalmente vacío y coge las medidas de su contenedor, en este caso la ventana del browser (html + body).

Te dejo una prueba rápida (copy-paste y lo pruebas):

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Caja a toda pantalla</title>
<style type="text/css">
html, body {
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	background: #fff;
}
#caja {
	width: 100%;
	height: 100%;
	background-color: #f00;
}
</style>
</head>

<body>
<!-- el div llamado caja no tiene contenido ninguno y ocupa la totalidad de la ventana -->

<div id="caja"></div>

</body>

</html> 
Saludos