Remember that these values will be relative to the next parent element with relative (or absolute) positioning. If there is no such parent, it will default all the way back up to the <html> element itself meaning it will be placed relatively to the page itself. 是在介绍绝对定位时提到的。
为了让大家好翻译,上文说的是:This is a very powerful type of positioning that allows you to literally place any page element exactly where you want it. You use the positioning attributes top, left bottom and right to set the location.
楼上的答案是不够准确的。
一个element的position有时候是根据他的containing block来计算的。 docs.
怎么找到某个element的containing block, 可以参考这张图。 docs.
Image Source: w3help.org. 本来都有解释的,但现在上不去了:(
root element是在HTML文档中是指
<html>
, See docs.initial containing block: 就是viewport的大小, 也就是page area。 docs.
根据上图,就可以翻译了。 Learn more on w3 - position scheme.