CSS Transform Functions Reference

All CSS transform functions — translate, rotate, scale, skew, matrix — with axes.

Reference for CSS 2D and 3D transform functions including translate, rotate, scale, skew, matrix, matrix3d and perspective, with argument types, default values and compositing order notes.

In what order do chained transform functions apply?

They are applied right to left in effect. transform: translateX(50px) rotate(45deg) first rotates the element, then translates the rotated coordinate system. Reordering the same functions produces a different result, so order is significant.

Moving, turning and reshaping boxes

The CSS transform property accepts a space-separated list of transform functions that move, rotate, scale, skew or matrix-compose an element without disturbing document flow. This reference lists every function in both 2D and 3D, with its syntax, argument types, defaults and the practical notes that trip people up.

How it works

Transforms operate around the transform-origin (the element centre by default) and are applied right to left: the last function in the list runs first on the element, then each preceding function transforms the already-transformed coordinate space. That is why translate() rotate() and rotate() translate() look different.

2D functions live in the screen plane. 3D functions add depth: translateZ, rotateX/Y, rotate3d, scaleZ and matrix3d only show their effect once a perspective establishes a vanishing distance — either via the perspective() function placed first in the list or the perspective property on the ancestor. Internally the browser collapses any chain into a single matrix, which is what you see when you read computed styles. Filter the list above by name or dimension.

Tips and examples

  • A flip is just a negative scale: scaleX(-1) mirrors horizontally, scale(-1) mirrors both axes.
  • translate3d(0,0,0) is a common way to promote an element to its own GPU layer for smoother animation, though will-change: transform is the explicit hint.
  • For 3D card flips, set perspective on the container, transform-style: preserve-3d on the rotating element, and backface-visibility: hidden on the faces.
  • Smaller perspective() distances exaggerate the 3D effect; large values flatten it.