Styling the `<html>` element in CSS?

前端 未结 6 1391
生来不讨喜
生来不讨喜 2020-12-08 10:01

Can anyone explain to me why can we style the element html?
What are differences between it and body?

I usually see tutorials and multi

6条回答
  •  無奈伤痛
    2020-12-08 10:32

    Offhand, I would say: is not a visible element per se, and it contains sections for semantic (e.g. ) and presentation data ().

    On the other hand, is a block for visible elements, so it can be given a presentation style.

    But people do apply styles to the element for a couple cases: (a) because all of its child elements will inherit that style, and (b) in special cases like the scrollbar trick that Jamie Dixon mentioned.

提交回复
热议问题