There are some chapters in the CSS spec mentioning "propagated to the viewport"; for example: calculating the height.
This section also applies to block-level non-replaced elements in normal flow when 'overflow' does not compute to 'visible' but has been propagated to the viewport.
What kind of attribute can propagate? And does it contradict with the rule in which a child element inherits an attribute from its parent?
As the quote states, the
overflow
property is capable of being propagated frombody
tohtml
, and fromhtml
to the viewport:The other property that can be propagated in this manner is
background
:This propagating behavior is specified for historical reasons (
<body background="..." bgcolor="...">
) as well as to enable authors to style the entire page background, something that cannot normally be done solely through thehtml
orbody
elements without first removing their default margins and forcing them to fill the page.Authors not aware of this behavior who try to apply these two properties to
body
andhtml
may be surprised by the results, especially when comparing the behavior with other elements. On the other hand, authors have also exploited this behavior to create interesting workarounds for browser bugs dating back over 15 years.This behavior does not conflict with inheritance because it works in the opposite direction. Inheritance "propagates" property values from a parent element to a child element; this behavior propagates property values from a child box to a parent box (
body
tohtml
, andhtml
to the viewport respectively).