Styling the `<html>` element in CSS?

前端 未结 6 1393
生来不讨喜
生来不讨喜 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:42

    html is the containing element for the whole document, it contains the which is what is rendered by the browser and which contains meta information on the page/document you are viewing. It has actually no use to be able to style the html element since it isn't rendered by the browser.

    It can however be used to build you css selectors with (html div.dataView { color: red } for example)

提交回复
热议问题