How to Combine Multiple CSS Transforms
Combine CSS translate, rotate, and scale without overwriting a transform. Copy working examples and see exactly how transform order changes the result.
5 min read - Updated 2026-09-05
Put multiple transform functions in one space-separated transform value: transform: translateX(20px) rotate(15deg) scale(1.1). A later declaration that wins the cascade replaces the entire transform value; it does not add another operation to the earlier one.
Combine the functions in one declaration
In this example, the first rule loses its translation because the second transform declaration replaces it. The combined version keeps both operations. Transform functions are separated by spaces, not commas.
.overwritten {
transform: translateX(20px);
transform: rotate(15deg); /* Only this value survives */
}
.combined {
transform: translateX(20px) rotate(15deg) scale(1.1);
}
The cascade chooses one transform value, including across classes and media queries.
A hover rule with only transform: scale(1.1) also replaces a base translation or rotation.
Why swapping rotate and translate changes the result
Transform matrices are multiplied in the order written; when applied to a point, the rightmost function acts first. Set transform-origin: 0 0 to make this example easy to reason about. The element’s origin moves right in the first case and down in the second.
.move-right {
transform-origin: 0 0;
transform: translateX(100px) rotate(90deg);
/* Rotate first, then move 100px along the original X axis. */
}
.move-down {
transform-origin: 0 0;
transform: rotate(90deg) translateX(100px);
/* Translate first; rotation turns that displacement downward. */
}
With the default centered transform-origin, the pivot changes the visible position too.
Keep function order intentional when comparing animation states.
Use individual properties for independent changes
The translate, rotate, and scale properties compose without replacing each other. The browser applies them in the fixed order translate, rotate, scale, then the transform property, regardless of declaration order. This makes a hover scale independent of a base translation.
.card {
translate: 20px 0;
rotate: 3deg;
scale: 1;
transition: scale 160ms ease;
}
.card:hover,
.card:focus-visible {
scale: 1.05;
}
@media (prefers-reduced-motion: reduce) {
.card { transition: none; }
}
Use the transform property when you need a different order or repeated operations.
Do not accidentally apply the same translation through both translate and transform.
transform: none does not reset the individual translate, rotate, or scale properties.
Debug a transform that jumps at a breakpoint
Inspect the computed transform and the individual properties before changing numbers. A media query or interaction state may replace a whole transform list. Also remember that transforms change the rendered position without moving surrounding elements in normal flow.
Check the winning CSS rule for the base, hover, focus, and responsive states.
Inspect transform-origin as well as the transform values.
Use getBoundingClientRect() when you need the transformed visual bounds.
Compare the same interaction across widths in Sizzy, then verify in the browser engines you support.
Practical checklist
Combine transform functions in a single value or use individual properties.
Choose the order and pivot deliberately.
Check state and media-query rules for accidental replacement.
Respect reduced-motion preferences when adding animated transforms.
Frequently asked questions
How do I apply multiple CSS transforms?
Use one transform declaration with space-separated functions, for example transform: translateX(20px) rotate(15deg). Separate transform declarations compete in the cascade instead of combining.
Are CSS transforms applied left to right or right to left?
Matrices compose in written order. When the resulting matrix acts on a point, the rightmost transform function acts first. Swapping rotate and translate therefore changes where the element ends up.
How do I scale on hover without losing a translation?
Use individual properties such as translate: 20px 0 and scale: 1, then change only scale on hover. Alternatively, repeat the full transform list in the hover rule, preserving its order.
Sources and further reading
Related guides
Benji
Your life OS
The companion app that keeps every area of your world in sync.
Zero to Shipped
Ship products, not side projects
The ultimate Next.js boilerplate for building and launching real products.
DMX
Mindful Twitter/X
The intentional X client for macOS. Reclaim your attention span.
Sotto
Voice-to-text for macOS
Speak naturally. Type instantly. 100% local & private.
Passlock
Password manager with willpower
Lock passwords with time delays, word challenges, or hand the keys to someone you trust.
Glink
Changelogs that slap
Beautiful changelogs and roadmaps for your product.
JoinRepo
GitHub access control
Monetize your GitHub repositories with ease.
Tubely
YouTube Studio for Mac
Manage multiple YouTube channels in one native app.
JustWrite
Distraction-free writing
A minimal writing app that helps you focus on what matters.