Home > Web Front-end > H5 Tutorial > 在HTML中 root和body?

在HTML中 root和body?

WBOY
Release: 2016-06-07 08:43:35
Original
2881 people have browsed it

:root{background:#..}和body{background:#...}的区别

回复内容:

root 指的是文档的根元素,对于 html 文档来说,就是 元素。
但是 :root { background: ... } 与 body { background: ... } 通常没有区别,这是因为 CSS 规范规定(drafts.csswg.org/css2/c)在没有单独设置 html 元素上的 background 时,直接应用 body 上的 background 属性的计算值。 zhihu.com/question/2031
详答看这个 实际上这不能算是html中的……是css样式表标准中规定了root的含义是整个文档,相对于html的标签
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template