Translate

Also called translateX or translateY

A CSS transform that moves an element along the x or y axis while the layout around it stays exactly where it was.

What is Translate?

transform: translate(40px, -20px) shifts where an element is drawn: 40px to the right and 20px up. Its original slot in the layout stays reserved, so neighbors never move and the element can slide over them. Percentages are based on the element's own size, which is why translate(-50%, -50%) centers an element on a point.

Translate powers most movement in interfaces: toasts sliding up, drawers sliding in, a card lifting a few pixels on hover, an item following your finger while you drag it. Browsers can usually move a transformed element without recalculating layout, so animating translate is much smoother than animating top, left, or margin.

Keep UI distances short, around 4 to 16px for entrances, so motion feels quick. Modern CSS also has a standalone translate property (translate: 0 8px) that you can set separately from transform. For people who prefer reduced motion, swap long slides for a simple fade.

Often confused with

Slide in
A slide-in is an entrance animation. Translate is the transform that usually moves the element during it.
All terms

Scale

A CSS transform that draws an element larger or smaller around its transform origin, without pushing neighboring elements.

Slide in

An entrance animation where an element moves into place from one side, often while fading in, so people see where it came from.

GPU acceleration

A browser technique where the graphics chip moves, fades, or scales an element on its own layer instead of redrawing the page every frame.

Layout thrashing

A slowdown caused by code that alternates style changes with size reads, forcing the browser to recalculate layout many times in one frame.