translate3d() | CSS属性参考

CSS translate3d()函数用于在3D空间中移动元素。

translate3d()函数的语法如下:

transform: translate3d( tx , ty, tz);

translate3d()函数用于在3D空间中移动元素。参数tx和ty可以是<length>值或<percentage>值。tz值必须是<length>值,不能是<percentage>值。

参数为正值会使元素沿相应轴正方向移动,负数值会使元素沿相应轴的负方向移动。

示例代码:

transform: translate3d(100px, 100px, -200px);
transform: translate3d(50%, -100%, 1em);
transform: translate3d(-100px, -30px, 5vw);
浏览器支持

CSS3 3D Transform的浏览器兼容性列表如下:

相关阅读
© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享