translate 和 translate3D 的区别

不定时更新

1.translate3D 可以调用GPU进行3D加速

2.translate 因为是 2D 移动,所以不能调用GPU进行3D加速

3.translate3D 可以在一个 z-axis (Z轴) 方向进行移动,正值会感觉元素离你更近,负值会感觉更远,不像translate只能平移。
参考:https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-function/translateZ

参考文档:
https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-function/translateY
https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-function/translateX
https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-function/translate3d

猜你喜欢

转载自www.cnblogs.com/xiaolantian/p/12658469.html