CSS Transform Scale
Predict Output Medium
Question
What happens to the element?
Code
.box {
width: 100px;
height: 100px;
transform: scale(1.5);
}
Hint
scale(1.5) makes it 1.5 times larger.
Explanation
transform: scale(1.5) scales the element to 1.5 times its original size. A 100px x 100px box becomes visually 150px x 150px. The transform does not affect the layout flow — other elements do not reposition. This makes transforms ideal for hover effects and animations as they are GPU-accelerated and performant.
Related Resources
Related Lessons
- CSS Animations
Learn CSS animations.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.