+ 1

behavior of body and html element in css?

The body and htnl elements behave strangely. For example, when you adjust the background-color of the body, it also applies to the its margin. Or sometimes to adjust the behavior of other elements (percentages), you need to adjust the height of the body and html "together" . explain to me.

6th Apr 2021, 8:03 PM
Mehran
Mehran - avatar
1 Answer
+ 1
I think they are special cases. Setting the background color of the body element is just a "special behavior", it doesn't refer to *just* the body's background color but in general the whole page's.
6th Apr 2021, 8:18 PM
inxanedev!
inxanedev! - avatar