C'è una questione di incongruenze tra i browser tra il tag <html>
e il tag <div>
, con <div>
con un comportamento più coerente. w3c consiglia di modificare il tag <body>
anziché il tag <html>
. Molto di questo ha di nuovo a che fare con il comportamento del browser moderno :
Many web developers do not understand the difference between applying
style to the body element versus the html element. Most of the time
these authors will apply style only to the body element; when that's
not sufficient, they'll spam all sorts of styles on both html and body
until the page happens to look correct.
The confusion is understandable. In the beginning, both were treated
similarly, with (now-deprecated) attributes like bgcolor being applied
to the body tag, affecting the whole page.
This article attempts to enlighten you, Web Developer, to fully grok
how these two elements are used in modern web browsers.