CSS properties to both the “html” and “body”

Xeye

New Member
I've seen this quite a few times now. When people want to assign a CSS property to the whole window/document, they sometimes do\[code\]html, body { myCSSProperty: someValue;}\[/code\]For example, see the answer I accepted here, or see this article.I am wondering if assigning CSS properties to both \[code\]html\[/code\] and \[code\]body\[/code\] is to overcome browser bugs, required for all browsers, a purely psychological thing, a common misconception or misunderstanding of the tags \[code\]html\[/code\] and \[code\]body\[/code\], or something else.I would be glad if someone could demystify the situation for me, separating the cases where CSS properties need to be assigned to \[code\]html\[/code\] or \[code\]body\[/code\], or both, with specific examples and explanations.
 
Top