A
A
Andy Oker2021-06-13 13:07:53
css
Andy Oker, 2021-06-13 13:07:53

Why is it that when I set a background for the body, the entire page is painted even though the body has a much smaller height?

60c5d8e5b2a6d477579628.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2021-06-13
@Ashlis

This is a special exception for backward compatibility
https://drafts.csswg.org/css-backgrounds-3/#body-b...
For documents whose root element is an HTML HTML element or an XHTML html element [HTML]: if the computed value of background-image on the root element is none and its background-color is transparent, user agents must instead propagate the computed values ​​of the background properties from that element's first HTML BODY or XHTML body child element. The used values ​​of that BODY element's background properties are their initial values, and the propagated values ​​are treated as if they were specified on the root element.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question