I found setting background color for entire <html>
element (without height set to 100%) result in the whole viewport was set to that color
This html
<!DOCTYPE html>
<html>
<head>
<style>
html {
background-color: green;
border: 5px dashed white;
margin : 20px
}
body {
background-color: wheat;
border: 5px dashed red;
margin : 20px
}
</style>
</head>
<body>
1
<br>
2
<br>
3
</body>
</html>
will result like this
Obviously, the height of html element is less than the height of viewport, why the background color could extend to whole viewport?