Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/10/2008, 15:54
Avatar de Mikmoro
Mikmoro
Colaborador
 
Fecha de Ingreso: octubre-2006
Ubicación: K-pax
Mensajes: 7.228
Antigüedad: 17 años, 6 meses
Puntos: 280
Respuesta: Body y html, body.

Sí, una importante diferencia: que una regla afecte o no al html puede ser determinante. Recuerda que html es el elemento básico, el nivel 1 de la página, y body es el nivel 2 (figuradamente).

Haz esta prueba: primero pon esto

Cita:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es-es">
<head>
<title>html, body</title>
<style type="text/css">
body {height: 100%; width: 100%;}
#uno {height: 100%; width: 100%; background: blue;}
</style>
</head>
<body>
<div id="uno">
</div>
</body>
</html>
y ahora añade html, delante de body:

Cita:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es-es">
<head>
<title>html, body</title>
<style type="text/css">
html, body {height: 100%; width: 100%;}
#uno {height: 100%; width: 100%; background: blue;}
</style>
</head>
<body>
<div id="uno">
</div>
</body>
</html>
¿Qué ha ocurrido?
__________________
Visita mi nueva web idplus.org