Translate Rotate and Scale
Move elements with translate(), rotate them with rotate(), and resize with scale().
Translate Rotate and Scale is a free CSS Academy lesson on CoddyKit. This is lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the CSS Academy learning path, and your progress syncs across the web and the CoddyKit app. The CSS Academy course includes 4 lessons in total.
The transform Property
transform applies 2D and 3D visual transformations to elements: movement, rotation, scaling, and skewing. Transforms happen after layout — they do not affect surrounding elements.
translate()
Moves an element from its current position. Arguments: x and y displacement.
<div class="card demo-active">Card</div>
<div class="wrap"><div class="centered">Centered</div></div>translateX() translateY() translateZ()
Individual axis functions for clarity:
<div class="slide-in active">Slide panel</div>rotate()
Rotates an element by a given angle. Positive values rotate clockwise.
<span class="icon demo-active">➤</span>
<span class="spinner">➤</span>scale()
Scales an element uniformly or by axis. Values less than 1 shrink; greater than 1 enlarge.
<button class="btn demo-active">Button</button>
<div class="thumb demo-active">Thumb</div>scaleX() and scaleY()
Scale independently on one axis:
<div class="logo">LOGO</div>Combining Transforms
Multiple transform functions are applied in order (right to left). Order matters for the result.
<div class="card demo-active">Card</div>Transform Origin
transform-origin sets the pivot point for rotations and scales. Default is center (50% 50%).
<div class="card demo-active">Card</div>Individual Transform Properties
Modern CSS allows setting individual transform functions as separate properties:
<div class="card demo-active">Card</div>Transition with Transforms
Transform is one of the two GPU-composited properties. Always animate it with transition for smooth, performant effects:
<div class="card demo-active">Card</div>translate() vs top/left
Always prefer transform: translate() over top/left for animation. Transform is GPU-composited; top/left triggers layout recalculation every frame.
Quick Check
Which transform function mirrors an element horizontally (like flipping a card)?
Recap
transform moves, rotates, and scales elements after layout without affecting surrounding content. Use translate() for movement, rotate() for rotation, scale() for resizing. Chain multiple functions in one declaration. Modern CSS supports individual transform properties. Always animate with transitions for GPU-composited performance.
Learn CSS with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 40
- Lessons
- 159
Frequently Asked Questions
Is the “Translate Rotate and Scale” lesson free?
Yes — the full text of “Translate Rotate and Scale” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the CSS Academy course, upgrade to CoddyKit PRO. The CSS Academy course includes 4 lessons in total.
What will I learn in “Translate Rotate and Scale”?
Move elements with translate(), rotate them with rotate(), and resize with scale(). You practise CSS Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start CSS Academy?
No prior experience is required. CSS Academy on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.
How long does the “Translate Rotate and Scale” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this CSS Academy lesson?
Yes. Every CSS Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Translate Rotate and Scale
- Skew and Matrix Transforms
- Transform Origin and Perspective
- 3D Transforms: rotateX rotateY translateZ