[英]What is the “root element” for rem?
Equal to the computed value of font-size on the root element.
等于根元素上font-size的计算值。 When specified on the font-size property of the root element, the rem units refer to the property's initial value.
当在根元素的font-size属性上指定时,rem单位引用属性的初始值。
What is this "root element" referring to? 这个“根元素”指的是什么?
<html>
? <html>
? <body>
? <body>
?
See the HTML specification . 请参阅HTML规范 。
For an HTML document, the root element is <html>
. 对于HTML文档,根元素是
<html>
。
See also the XML specification : 另请参阅XML规范 :
There is exactly one element, called the root, or document element, no part of which appears in the content of any other element.] For all other elements, if the start-tag is in the content of another element, the end-tag is in the content of the same element.
只有一个元素,称为根或文档元素,其中任何部分都不会出现在任何其他元素的内容中。]对于所有其他元素,如果start-tag在另一个元素的内容中,则为end-tag是在同一元素的内容中。
All bodies of web with html standards start with <html>
.This is why the root element is html tag. 所有带有html标准的web主体都以
<html>
开头。这就是为什么根元素是html标签。 Even if you remove html tag from a html file and open it using browser, you can check the code by inspect element
feature that browsers added html tags for you. 即使您从html文件中删除html标记并使用浏览器打开它,您也可以通过
inspect element
功能检查代码,浏览器为您添加了html标记。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.