I have the following HTML:
<body class="page">
</body>
and tied to that selector, the following rule:
.page {
background-color: #2A2C2F;
}
From what the above picture shows, the body
element takes up its containing elements' width (naturally, as it is a block
level element) and has no height. Even with this being the case however, I see that the entirety of the viewport takes on the background-color
that I have set. According to this freeCodeCamp article, the background-color
only affects the content area and padding of an element (although I wonder if we can change that with the box-sizing
rule).
Why is it that even without a height, the viewport seemingly takes on the background-color
?