# scale()

> The `scale()` CSS function resizes an element on the X and Y axes proportionally.

## How do I make an element bigger on hover with scale() in CSS?

The function that scales an element by a specified factor along both the X and Y axes. It increases or decreases the size of an element proportionally, enabling to zoom in or out on an element while maintaining its original aspect ratio.

- Topic: Transformations
- Type: function
- Browser support: Chrome 1+, Chrome Android 18+, Edge 12+, Firefox 3.5+, Firefox Android 4+, Safari 3.1+, Safari iOS 3.2+

## Example

Wrong:

```css
.thumb:hover img {
  width: 110%;
  height: 110%;
}
```

Right:

```css
.thumb {
  overflow: hidden;
}
.thumb img {
  transition: transform 0.3s;
}
.thumb:hover img {
  transform: scale(1.1);
}
```

`scale()` zooms without changing layout, and `overflow: hidden` keeps the image inside its frame.

## Common mistakes

- Text inside a scaled element looks blurry during the animation.
- A zoomed image spills out of its rounded card.

## Key points

- Hover zoom uses `transform: scale()` instead of animating `width` and `height`.
- `transform-origin` is set when scaling must grow from a corner or edge instead of the center.
- Images zoomed inside a card are clipped with `overflow: hidden` on the wrapper.

## Interview questions

### Does scale() change the element's size in the layout?

No. The element keeps its layout box; only its painted size changes, so neighbors do not move.

### How do I flip an element with scale()?

Use a negative value: `scale(-1, 1)` mirrors it horizontally, and `scale(1, -1)` flips it vertically.

## Related cards

- [scale](https://wonderium.dev/css/scale-property.md)
- [scaleX()](https://wonderium.dev/css/scale-x.md)
- [transform-origin](https://wonderium.dev/css/transform-origin.md)
- [transform](https://wonderium.dev/css/transform.md)
- [transition](https://wonderium.dev/css/transition.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/scale
- Last updated: 2026-11-25
