The transform property lets you translate, rotate, scale, or skew an element visually. It changes how the element is painted, not how much space it keeps in normal flow.
Any value other than none creates a stacking context. You can also use the individual properties translate, rotate, and scale, which run before transform.
Standard-track.
Baseline widely available for 2D transforms. Not deprecated as a property.
Accessibility motion
Animated scale/zoom can trigger discomfort. Respect prefers-reduced-motion when you animate transforms.
Applies to transformable elements.
Non-replaced inline boxes (plain span text) do not transform. Use a block or inline-block box instead.
Write left to right.translate runs first, then rotate.
New axes after each step. Later functions use the updated coordinate space.
Swap to compare.rotate(15deg) translate(20px) lands in a different place.
One declaration. A second transform rule would replace the first, not add to it.
Edge Cases & Pitfalls
If a transform looks wrong, one of these is usually why.
flow
Layout space does not move
Transformed paint can overlap neighbors, but margins and following boxes still use the original box. Use positioning or margins when you need real layout space.
order
Function order matters
translate then rotate is not the same as rotate then translate. Swap intentionally when debugging.
inline
Plain inline text will not transform
Non-replaced inline elements are not transformable. Set display: inline-block or use a block-level element.
stack
Non-none creates a stacking context
Absolute/fixed descendants are contained by a transformed ancestor. That can surprise you with overlays and modals.
replace
One transform replaces another
You cannot add a second transform declaration to stack more functions. Put every function in the same value, or use the individual translate / rotate / scale properties.
Compatibility
Browser Support
transform is a browser CSS property for visual transforms. Node.js, Deno, and Bun do not apply it.
Bottom line: Safe for everyday 2D translate, rotate, and scale. Prefer unprefixed modern syntax; vendor prefixes are no longer needed for current browsers.
Order: functions apply left to right; swapping them changes the result.
Side effect: non-none creates a stacking context.
One line: use transform for visual motion and shape changes; keep layout spacing with margins or positioning when the gap must stay empty.
Frequently Asked Questions
It applies visual transforms such as translate, rotate, scale, and skew. The element keeps its original layout space; only the painted result moves.
none. No transformation is applied.
Yes. Space-separate them in one declaration, for example transform: translate(20px) rotate(15deg). Order matters.
No. Neighbors still lay out as if the element were untransformed. Overlap is common when you move or scale a lot.
translate, rotate, and scale are individual longhands applied before the transform property. transform can combine many functions in one value.
Baseline widely available for 2D transforms (Chrome 4+, Firefox 3.5+, Safari 3.1+, Edge 12+, IE 9+). 3D functions are also widely supported in modern browsers. It is a browser CSS property, not a Node.js feature.