why -webkit-transform: translate3d(0, 0, 0) messes up with fixed childs

后端 未结 2 395
不知归路
不知归路 2020-12-31 01:27

I\'ve been trying for the last few hours to figure out how come a child element was positioning against its parent and not the screenport even though it\'s positioned as \'f

2条回答
  •  悲哀的现实
    2020-12-31 02:07

    Regarding your first question:

    You are using transforms. That's what's causing the problem.

    Take a look at the spec: The Transform Rendering Model

    Specifying a value other than ‘none’ for the ‘transform’ property establishes a new local coordinate system at the element that it is applied to.

    So the element with fixed positioning will become relative to the element with the transform - not the viewport

提交回复
热议问题