translate
Description
The translate function for CSS specifies a 2D translation by the vector [tx, ty], where tx is the first translation-value parameter and ty is the optional second translation-value parameter. If the second parameter is not provided, it has a zero value.
Syntax
CSS
translate()
Values
<translate()> = translate( <length-percentage> , <length-percentage>? )
<length-percentage> = <length> | <percentage>
<length>
Specifies the length using a number followed by a unit of measurement.
<percentage>
Specifies the percentage using a number followed by a percent sign (%).
Examples
1 · length
2 · percentage
3 · JS
Links
Related
Functions
- abs
- acos
- asin
- atan
- atan2
- attr
- calc
- clamp
- color
- conic-gradient
- cos
- counter
- counters
- hsl
- hsla
- hwb
- lab
- lch
- linear-gradient
- matrix
- matrix3d
- max
- min
- mod
- oklab
- oklch
- param
- perspective
- radial-gradient
- rem
- repeating-conic-gradient
- repeating-linear-gradient
- repeating-radial-gradient
- rgb
- rgba
- rotate
- rotate3d
- rotateX
- rotateY
- rotateZ
- round
- scale
- scale3d
- scaleX
- scaleY
- scaleZ
- sin
- skew
- skewX
- skewY
- src
- tan
- translate3d
- translateX
- translateY
- translateZ
- url
- var