translate3d() CSS Function
Description
The translate3d() CSS function is a powerful method used to move an element in three-dimensional space along the X, Y, and Z axes. Unlike its 2D counterpart translate(), translate3d() allows you to specify movement in the Z direction, giving elements a sense of depth when combined with transform properties and perspective settings. This function can be particularly useful for creating animations, transitions, and interactive UI effects that require a more immersive visual experience.
When using translate3d(), you provide three values: the first for horizontal movement (X-axis), the second for vertical movement (Y-axis), and the third for depth (Z-axis). Positive values move the element forward along the axis, while negative values move it backward. The units can be pixels, percentages, or other CSS length units. Movement along the Z-axis is most effective when combined with perspective, which allows the browser to render the element with realistic depth.
For example, applying translate3d(50px, 100px, 30px) to a div would move it 50 pixels to the right, 100 pixels down, and 30 pixels toward the viewer. Animations using translate3d() are often more performant than animating left or top properties, because they leverage the GPU for smoother transitions.
Another common use case is combining translate3d() with rotate3d() or scale3d() to create complex 3D transformations, such as flipping cards or simulating a 3D carousel. This makes it a versatile tool for modern web design where depth and motion are desired.
Example usage:
.card {
transform: translate3d(20px, 40px, 50px);
transition: transform 0.5s ease-in-out;
}
This would smoothly move the element along all three axes over half a second when the transformation is applied.
Syntax
transform: translate3d( tx, ty, tz);
Values
- txHorizontal shift. A positive value shifts to the right, a negative value to the left.
- tyVertical shift. A positive value moves up, a negative value down.
- tzA positive value moves the element towards the viewer, and a negative value farther away.
Example
Browser Support
The following information will show you the current browser support for the CSS translate3d() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
This function is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
