CSS transform

The CSS property that moves, rotates, scales or skews an element without changing the layout around it.

In more detail

transform is cheap to animate, but it also creates a stacking context and a containing block, which can clip or misplace overlays inside it. It is also the property that the reduced-motion guidance most often targets, because large movements and zooms are made with it.

Example

In the browser: transform: translateY(20px) shifts an element down on screen while surrounding elements stay where they are. Because it skips layout and paint, it is the preferred property for smooth animation.

Related terms

Taught in

References