gpt4 book ai didi

html - CSS绝对定位, "non-statically positioned ancestor"是什么?

转载 作者:太空宇宙 更新时间:2023-11-03 23:36:08 26 4
gpt4 key购买 nike

所以我一直在关注this tutorial ,以更清楚地了解相对和绝对定位。大多数事情都很清楚,但在文章末尾它说关于绝对定位。

..it doesn’t always default to the top left of the browser window. Instead, what position: absolute; really does is position the element relative to its first non-statically-positioned ancestor (inherit doesn’t count either)...

有人可以用外行的话来说一下吗?谢谢

最佳答案

非静态定位元素是将 position 属性设置为 static (默认值) 以外的任何元素。。

例如:position: relative ||绝对||固定

如果找不到这样的定位祖先,absolute 定位元素将相对于窗口定位。

关于html - CSS绝对定位, "non-statically positioned ancestor"是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24076589/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com