translateX() function
Specifies a translation by a given amount in the x-direction.
![]() ![]() |
Syntax
translateX
(
<translation-value>
)
Parameters
- translation-value
-
A translation value.
Standards information
- CSS Transforms Module, Level 3, Section 13.1
Examples
The following code snippet is an example of the translateX function in use. When applied to a square blue div element, it has the effect illustrated in the image. (The light-blue square indicates the original position of the transformed element.)
div {
transform: translateX(40px);
}

Requirements
See also
Show:

