0
Isn't the height and width of<body> element same as the viewport's height and width?
2 ответов
+ 2
not necessarily.
browsers often apply a default margin or padding, so the body width is actually smaller than the viewport width. and the height is 0 if the body is empty.
that's why we often use css reset to start everything at a predictable default.
https://sololearn.com/compiler-playground/WXmhoUrJJolF/?ref=app
+ 1
Thank you Bob