CSS scale Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
Transforms

What You’ll Learn

The scale property resizes an element visually along the X and Y axes. It is useful for hover effects, emphasis, and playful UI without changing width and height properties directly.

01

none

Default size.

02

1.5

Grow bigger.

03

0.8

Shrink.

04

2 1

X and Y.

05

origin

Pivot point.

06

hover

Motion UI.

Introduction

The scale property in CSS is used to change the size of an element. This property allows you to scale an element up or down along the X and Y axes, without affecting its original dimensions in the layout.

The scaling is relative to the element’s transform-origin, which is usually the center by default. The scale property is part of the CSS Transforms module and is used to create dynamic and responsive designs.

Definition and Usage

Use scale: 1.05 for subtle hover growth, scale: 0.9 for pressed-button feedback, or scale: 2 1 when only the width should stretch visually.

You may also see transform: scale(2, 1) in older examples. The standalone scale property is the modern equivalent and works well with CSS transitions.

💡
Beginner Tip

A scale factor of 1 means original size. 2 doubles the size visually, and 0.5 halves it.

📝 Syntax

The syntax for the scale property involves specifying the scale factors for the X and Y axes. You can scale an element uniformly or non-uniformly.

syntax.css
element {
  scale: sx sy;
}
  • sx is the scaling factor along the X-axis.
  • sy is the scaling factor along the Y-axis (optional).

Basic Example

scale-box.css
.box {
  scale: 2 1;
}

Syntax Rules

  • One value scales both axes equally, such as scale: 1.5.
  • Two values set X first, then Y, such as scale: 2 1.
  • Values above 1 enlarge the element visually.
  • Values between 0 and 1 shrink the element visually.
  • none resets scaling to the default size.
  • Use transform-origin to change the pivot point.

🎯 Default Value

The default value of the scale property is none, which means the element is rendered at its original size. This is equivalent to a scale factor of 1.

⚡ Quick Reference

QuestionAnswer
Default valuenone (same visual effect as 1)
Uniform growthscale: 1.5;
Different X and Yscale: 2 1;
Pivot controltransform-origin
InheritedNo
AnimatableYes

💎 Property Values

ValueExampleDescription
numberscale: 1.5;A positive number that defines the scaling factor. A value greater than 1 increases the size, and a value between 0 and 1 decreases the size.
two numbersscale: 2 1;Separate scale factors for the X-axis and Y-axis.
nonescale: none;No scaling is applied.
none 1.5 0.75 2 1

When Does scale Matter?

scale is the right tool when you want visual resizing without editing width and height:

  • Hover cards — Gently enlarge tiles on mouse hover.
  • Buttons — Shrink slightly on press for tactile feedback.
  • Icons — Emphasize one action without reflowing layout.
  • Image previews — Zoom content inside a fixed frame.

For true layout resizing that affects surrounding content, change width, height, or use layout systems like Grid and Flexbox.

👀 Live Preview

The blue box uses scale: 1.5 1, so it looks wider while keeping the same layout box size.

Scaling happens around the center by default.

Examples Gallery

Start with the reference non-uniform scale, compare uniform growth, shrink with values below 1, and animate scale on hover.

📐 Resize in 2D

Change visual size along one or both axes — matching the reference example.

Example 1 — scale: 2 1

In this example, we’ll scale an element to twice its size on the X-axis and keep its original size on the Y-axis.

scale-2-1.html
<style>
  .box {
    width: 100px;
    height: 100px;
    background-color: blue;
    scale: 2 1;
  }
</style>

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

How It Works

The first value stretches the element horizontally. The second value keeps the vertical scale at normal size.

Example 2 — Uniform scale: 1.5

Use one value to grow both width and height equally: scale: 1.5.

scale-uniform.html
<style>
  .grow {
    scale: 1.5;
  }
</style>
Try It Yourself

How It Works

When only one number is provided, both axes use the same scale factor.

🔀 Shrink & Motion

Use values below 1 and transitions for interactive UI feedback.

Example 3 — Shrink with scale: 0.75

Values between 0 and 1 make an element look smaller while keeping its layout footprint.

scale-shrink.html
<style>
  .compact {
    scale: 0.75;
    transform-origin: top left;
  }
</style>
Try It Yourself

How It Works

Changing transform-origin makes the shrink feel anchored to a corner instead of the center.

Example 4 — Hover Grow Effect

Animate scale with transition for a smooth hover zoom on cards and buttons.

scale-hover.html
<style>
  .tile {
    scale: 1;
    transition: scale 0.25s ease;
  }

  .tile:hover {
    scale: 1.08;
  }
</style>
Try It Yourself

How It Works

Small scale changes such as 1.08 feel responsive without looking exaggerated.

scale vs transform: scale()

The standalone scale property is the modern way to resize elements visually. The classic form is transform: scale(2, 1), which still appears in many tutorials.

Pair scaling with rotate and transform-origin when building richer transform effects.

scale-with-origin.css
.badge {
  transform-origin: center;
  scale: 1.1;
}

🧠 How scale Works

1

Choose scale factors

Set one value for uniform scaling or two values for X and Y.

scale
2

Pick the pivot

transform-origin decides which point stays fixed while scaling.

origin
3

Browser paints the transform

The element appears larger or smaller without changing its layout box by default.

Visual resize
=

Responsive motion

Hover zoom, emphasis, and playful UI effects with a single property.

Browser Compatibility

The scale property is widely supported in modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. Ensure you test your website across different browsers to guarantee compatibility.

Transforms · Modern support

Reliable scale support

Current Chrome, Firefox, Safari, Edge, and Opera support the standalone scale property.

96% Modern browser support
Google Chrome 104+ · Desktop & Mobile
Full support
Mozilla Firefox 72+ · Desktop & Mobile
Full support
Apple Safari 14.1+ · macOS & iOS
Full support
Microsoft Edge 104+ · Chromium
Full support
Opera 90+ · Modern versions
Full support

Testing tip

For older browser support, keep transform: scale() as a fallback alongside the standalone scale property.

scale property 96% supported

Bottom line: The standalone scale property is safe in modern projects; use transform: scale() only when older fallback support is required.

Conclusion

The scale property is a versatile and powerful tool for web developers aiming to create dynamic and interactive designs.

By adjusting the size of elements responsively, you can enhance the visual appeal and functionality of your web projects. Experiment with different scaling factors to see how this property can transform your designs.

💡 Best Practices

✅ Do

  • Use small hover values like 1.05 or 1.08
  • Set transform-origin when the pivot matters
  • Animate scale with transition for smooth UI feedback
  • Keep scale effects subtle on text-heavy components
  • Provide transform: scale() fallback only when needed

❌ Don’t

  • Use huge scale values that break layouts or overflow containers
  • Expect scale to replace real responsive width and height changes
  • Scale body text so much that readability suffers
  • Forget that scaled elements may overlap neighbors visually
  • Overuse motion effects on every interactive element

Key Takeaways

Knowledge Unlocked

Five things to remember about scale

Use these points when resizing elements visually.

5
Core concepts
02

1 = normal

No change.

Baseline
03

2 1

Axis control.

Pattern
04

origin

Pivot point.

Companion
🔄 05

transition

Smooth hover.

Motion

❓ Frequently Asked Questions

scale changes the visual size of an element along the X and/or Y axis. A value of 1 keeps the original size, values above 1 enlarge it, and values between 0 and 1 shrink it.
scale is a standalone transform property. transform: scale() is the older function form. Both resize elements visually, but the standalone property is easier to animate.
The initial value is none, which means no scaling is applied. Visually this matches a scale factor of 1.
Usually no. scale affects the painted appearance, but the element often keeps its original layout box unless other layout rules change.
Yes. Use two values such as scale: 2 1 to scale horizontally twice while keeping the original vertical size visually.

Practice in the Live Editor

Open the HTML editor and try scale: 2 1 on a square element.

HTML Editor →

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.

5 people found this page helpful