The CSS transform property lets you move, rotate, scale, or skew an element visually — without affecting the layout of anything around it. That last part is what makes transform special: changing an element's width or margin pushes its siblings around, but transforming it only changes how it's drawn on screen, leaving its original space in the document flow untouched. This also makes transforms very cheap for the browser to animate smoothly, which is why they're the backbone of most CSS transitions and animations.

translate, rotate, and scale

.move-right {
  transform: translateX(20px);   /* shifts 20px to the right */
}

.rotate-slightly {
  transform: rotate(8deg);       /* rotates 8 degrees clockwise */
}

.grow {
  transform: scale(1.2);         /* 20% larger in both directions */
}

.shrink-width-only {
  transform: scaleX(0.8);        /* 80% width, height unchanged */
}

translate() moves an element along the X and/or Y axis — translateX(), translateY(), or translate(x, y) for both at once. rotate() spins it around its center by a given angle. scale() resizes it proportionally — values above 1 grow it, values below 1 shrink it, and you can target just one axis with scaleX()/scaleY().

Combining Multiple Transforms

You can chain several transform functions in a single declaration, separated by spaces — and order matters, since each one is applied in sequence to the result of the last.

<div class="card">Hover me</div>
.card {
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-6px) scale(1.03) rotate(-1deg);
}

This lifts the card up slightly, grows it a touch, and tilts it a tiny bit on hover — a combination commonly used for interactive cards — all three effects applying together in one smooth, GPU-accelerated motion.

transform-origin

By default, rotate() and scale() pivot around the element's exact center. transform-origin lets you move that pivot point — useful for things like a button that should grow from its left edge instead of expanding symmetrically in both directions.

.grow-from-left {
  transform-origin: left center;
  transform: scale(1.1);
}

This scales the element up by 10%, but anchored to its left edge rather than its center — so it visibly grows to the right while its left edge stays fixed in place, instead of expanding outward in both directions at once.

A useful mental model: think of transform as repositioning a photograph of the element after layout has already been calculated, rather than changing the element itself — which is exactly why it doesn't disturb surrounding content and why it's the property of choice for smooth, performant hover effects and animations.