CSS scale Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The scale property resizes an element around its transform-origin. One value scales X and Y the same. Two values set X then Y. Three values add a Z factor for 3D.

It is an individual transform property, like translate and rotate. That lets you change size without rewriting a full transform list. The initial value is none. It is not inherited and creates a stacking context when not none.

Baseline · Widely available.

Not deprecated. Supported in modern browsers since about 2022. For very old browsers, fall back to transform: scale(…).

CSS Syntax

syntax.css
scale: none | [<number>|<percentage>]{1,3};

Example: scale: 1.5; or scale: 2 1;. Factors above 1 grow; below 1 shrink. none matches a factor of 1.

Property Values

ValueDescriptionTry it
noneNo scaling. Initial value (like 1)Try it
One number / %Same factor on X and Y (for example 1.5 or 50%)Try it
Two valuesX then Y (for example 2 1)Try it
Negative factorFlips an axis (for example 1 -1)Try it
initial / inheritReset to none, or copy from the parentTry it

How to Use scale

Pick a factor (and optional second/third axes), then adjust the origin if growth looks off-center.

  1. Choose the element to resize (any transformable box).
  2. Set scale to one, two, or three numbers/percentages.
  3. Change transform-origin if you need a different growth point.
  4. Optional: pair with transition for hover motion — respect prefers-reduced-motion when animating.
PieceRequired?Role
Factor or noneYesHow much to grow or shrink
Second / third valueOptionalIndependent Y (and Z) scaling
transform-originOptionalWhere the resize pivots from
Fixed apply order—Always translate → rotate → scale → transform

Live Preview

Change scale on the sample box. The dashed frame is the original layout space.

Layout size of the box does not change. Neighbors would not reflow.

Box
Scale

scale: 1.5

CSS Examples

Each snippet focuses on scale. Extra styles stay minimal for study. Use Try It Yourself for a live editor.

Example 1 — Uniform Scale

Grow a box to 1.5× on both axes around its center.

CSS
<style>
  .box {
    scale: 1.5;
    background: #2563eb;
    color: #fff;
    padding: 16px;
    width: 80px;
    text-align: center;
  }
</style>

<div class="box">1.5</div>
Try It Yourself

How It Works

  1. Set one factor. scale: 1.5 enlarges X and Y the same amount.
  2. Center by default. Growth pivots from the middle unless you change origin.
  3. Layout box stays. The element still occupies its original space for layout.
  4. Same as scale(). This matches transform: scale(1.5), but alone.

Example 2 — Different X and Y

Stretch horizontally twice while keeping the original height.

CSS
<style>
  .box {
    scale: 2 1;
    background: #2563eb;
    color: #fff;
    padding: 16px;
    width: 80px;
    text-align: center;
  }
</style>

<div class="box">2 1</div>
Try It Yourself

How It Works

  1. Two values. First number is X; second is Y.
  2. Widen only. 2 1 doubles width visually and leaves height alone.
  3. Percentages work too. 200% 100% means the same thing.
  4. Still paint-only. Layout neighbors do not move.

Example 3 — Hover Scale

Animate a slight grow on hover with a short transition.

CSS
<style>
  button {
    scale: 1;
    transition: scale 0.25s ease;
    background: #2563eb;
    color: #fff;
    border: 0;
    padding: 12px 16px;
  }
  button:hover {
    scale: 1.15;
  }
</style>

<button type="button">Hover me</button>
Try It Yourself

How It Works

  1. Start at identity. scale: 1 keeps a stacking context stable before hover.
  2. Transition only scale. transition: scale 0.25s ease animates that property.
  3. Grow on hover. scale: 1.15 enlarges the button slightly.
  4. Why individual helps. You did not need to rewrite a full transform list.

Edge Cases & Pitfalls

If the resize looks wrong, one of these is usually why.

layout

Does not reflow neighbors

Scaled paint can overlap nearby content. Change width/height (or grid/flex) if you need real layout space.

order

Fixed apply order with translate / rotate

Individual transforms always run as translate → rotate → scale → transform. Need a different order? Use transform functions instead.

origin

Wrong growth point

Scaling expands from transform-origin. Change it when the box grows from the wrong spot.

stack

Creates a stacking context

A non-none scale creates a stacking context. Prefer scale: 1 in the base state if hover would otherwise change stacking suddenly.

fallback

Older browsers need transform

IE and pre-2022 engines lack scale. Use transform: scale(1.5) (or @supports) when you must support them.

Browser Support

scale is a browser CSS property for individual transforms. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

scale

Chrome 104+, Edge 104+, Firefox 72+, Safari 14.1+ / iOS 14.5+. Not supported in Internet Explorer.

96% Global support
Google Chrome 104+
Full support
Mozilla Firefox 72+
Full support
Apple Safari 14.1+
Full support
Microsoft Edge 104+
Full support
Opera 90+
Full support
Samsung Internet 20+
Full support
Internet Explorer No support
No support
scale Widely supported

Bottom line: Safe for modern sites. Fall back to transform: scale() for older browsers. This is not a JavaScript runtime API.

Key Takeaways

  • Role: resize independently of the transform list — one, two, or three factors.
  • Initial: none. Visually like 1. Above 1 grows; below 1 shrinks.
  • Order: translate → rotate → scale → transform.
  • Paint only: layout box usually stays; control the pivot with transform-origin.

One line: scale resizes the painted box — without rewriting the whole transform stack.

Frequently Asked Questions

It resizes an element visually along the X and/or Y axes (and optionally Z) without using the transform shorthand. One value scales both axes. Two values set X then Y.
Both resize the painted box. scale is an individual transform property you can set and animate alone. transform: scale() lives inside the older transform list and must be rewritten with any other transform functions you keep.
The initial value is none, which means no scaling. Visually that matches a factor of 1 (or 100%).
No. It changes how the element is painted. The original layout box usually stays the same, so neighbors do not reflow.
Individual transform properties always run in a fixed order: translate, then rotate, then scale, then any transform property last — regardless of source order in your CSS.
It is Baseline Widely available: Chrome 104+, Edge 104+, Firefox 72+, Safari 14.1+. It is a browser CSS property, not a Node.js feature. Prefer transform: scale() only if you must support older browsers.

Next: scroll-behavior

Control smooth scrolling for the viewport or scroll containers.

scroll-behavior tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful