CSS transform vs position

后端 未结 4 1790
南笙
南笙 2020-12-14 17:22

Can some please explain to me the difference in transitioning the positional left or right properties or the -transform: translateX(n)

4条回答
  •  攒了一身酷
    2020-12-14 17:45

    top and left CSS properties work only on elements positioned relative, absolute or fixed. Also, top and left properties rely on the parent's position (relative it, absolute or static). Translations are not affected by that settings.


    Translation transformations are "identical" to applying top and left when element has position: relative. In any other case they aren't the same operations.

提交回复
热议问题