translate() function
Specifies a 2-D translation by the vector [tx,ty], where tx is the first translation-value parameter and ty is the optional second translation-value parameter.
![]() ![]() |
Syntax
translate
(
<translation-value-x>
[ ,
<translation-value-y>
])
Parameters
- translation-value-x
-
A translation value along the x-axis.
- translation-value-y
-
Optional. A translation value along the y-axis.
Standards information
- CSS Transforms Module, Level 3, Section 13.1
Examples
The following code snippet is an example of the translate 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: translate(47px, -38px);
}

Requirements
See also
Show:

