CSS translate Property

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The translate property moves an element along the X, Y, and optionally Z axes — independently of the transform property.

The initial value is none. It is not inherited. A non-none value creates a stacking context. Pair it with rotate and scale for clear UI motion, or keep using transform: translate() when you need one combined list.

Baseline · Widely available.

Not deprecated. Standard-track individual transform property. Fixed apply order with siblings: translate → rotate → scale → then transform.

CSS Syntax

syntax.css
translate: none | <length-percentage> | <lp> <lp> | <lp> <lp> <length> | initial | inherit;

Examples: none; · 40px; · 50% -40%; · 20px 4rem 150px;

Property Values

ValueDescriptionTry it
noneDefault. No translationTry it
One valueMove along X only (length or %)Try it
Two valuesMove along X then YTry it
PercentagesRelative to the element’s own width (X) and height (Y)Try it
Three valuesX, Y, and Z (Z must be a length)Try it
initial / inheritReset to none, or take the parent valueTry it

How to Use translate

Pick axes and distances, then apply the property to a transformable element.

  1. Choose X only, X+Y, or X+Y+Z for the move you need.
  2. Use lengths (px, rem) or percentages of the element’s own box.
  3. Set translate on the element (not on a non-replaced inline).
  4. Optional: add a transition so hover/focus motion eases smoothly.
PieceRequired?Role
ValueYesnone or 1–3 axis distances
Transformable elementYesBlock/replaced boxes; not non-replaced inline
Layout space—Unchanged — only the painted position moves
With rotate / scaleOptionalFixed order: translate, then rotate, then scale

Live Preview

Pick a value. The blue box moves; the dashed outline shows its original layout space.

Dashed outline = layout box. Solid box = painted position after translate.

Stage

translate: 40px

CSS Examples

Each snippet focuses on translate. Extra CSS is only for a clear demo box. Use Try It Yourself for a live editor.

Example 1 — Move on X

One value shifts the element horizontally.

CSS
<style>
  .box {
    width: 64px;
    height: 64px;
    background: #2563eb;
    translate: 40px;
  }
</style>

<div class="box"></div>
Try It Yourself

How It Works

  1. One length. translate: 40px moves only on the X axis.
  2. Positive X. The box shifts right; negative would move left.
  3. Layout stays. Space in the document is unchanged — only the paint moves.
  4. Same as transform: translate(40px), but as its own property.

Example 2 — Move on X and Y

Two values set horizontal and vertical offsets.

CSS
<style>
  .box {
    width: 64px;
    height: 64px;
    background: #2563eb;
    translate: 48px 24px;
  }
</style>

<div class="box"></div>
Try It Yourself

How It Works

  1. First value = X. 48px moves right.
  2. Second value = Y. 24px moves down (negative moves up).
  3. Both at once. Equivalent to transform: translate(48px, 24px).
  4. Still no reflow. Other content does not shift for this paint offset.

Example 3 — Percentage Offsets

Percentages are relative to the element’s own width and height.

CSS
<style>
  .box {
    width: 80px;
    height: 80px;
    background: #2563eb;
    translate: 50% -25%;
  }
</style>

<div class="box"></div>
Try It Yourself

How It Works

  1. X % = own width. 50% of an 80px-wide box is 40px right.
  2. Y % = own height. -25% of 80px is 20px up.
  3. Not the parent. Percentages do not use the containing block size.
  4. Centering tip. Patterns like -50% -50% often help center overlays with absolute positioning.

Edge Cases & Pitfalls

If the box moves but layout looks “empty,” check these first.

layout

Visual move only

Neighbors do not reflow. Gaps and overlap can appear because the original box still occupies space.

percent

% is relative to itself

X % uses the element’s width; Y % uses its height — not the parent’s size.

z

Z cannot be a percentage

A third value must be a length (px, rem, …). Percentage on Z is invalid.

order

Fixed order with rotate / scale

Individual transforms always apply as translate → rotate → scale, then any transform list. Declaration order does not change that.

stack

Creates a stacking context

Any value other than none creates a stacking context, which can affect how z-index and overlays layer.

Browser Support

translate is a browser CSS property for individual transforms. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

translate

Individual translate is widely supported in modern browsers (from about Chrome/Edge 104, Firefox 72, Safari 14.1). Prefer unprefixed syntax.

95% Core support
Google Chrome 104+
Full support
Mozilla Firefox 72+
Full support
Apple Safari 14.1+
Full support
Microsoft Edge 104+
Full support
Opera 90+
Full support
Samsung Internet 20+
Full support
Internet Explorer —
No support
translate Widely supported

Bottom line: Safe to teach for modern browsers. IE has no support — use transform: translate() if you must support legacy engines. It is not a runtime API.

Key Takeaways

  • Role: move an element on X / Y / Z without changing flow.
  • Initial value: none — no offset.
  • vs transform: standalone move property; pairs cleanly with rotate and scale.
  • % tip: based on the element’s own size; Z must be a length.

One line: translate shifts where an element is painted; layout space stays put.

Frequently Asked Questions

It moves an element visually along the X, Y, and optionally Z axes without changing document flow. It is an individual transform property separate from transform.
The initial value is none — no translation is applied.
translate is a standalone property for movement only. transform: translate() is one function inside the transform list and can sit beside rotate, scale, and skew.
No. The element keeps its original layout box. Neighbors do not reflow when it moves.
Percentages refer to the element’s own border box — width for X, height for Y. The optional Z value must be a length, not a percentage.
It is Baseline Widely available (Chrome/Edge 104+, Firefox 72+, Safari 14.1+). It is a browser CSS property, not a Node.js feature.

Next: unicode-bidi

Learn how unicode-bidi controls embedding levels for bidirectional text.

unicode-bidi tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful