# field-sizing

> The `field-sizing` CSS property controls whether form controls adjust their size to fit their content.

## How do I make a textarea grow with its content in CSS?

The property that allows form controls like `<textarea>` and `<input>` to grow and shrink with their contents with the 'content' value. Replaces JS solutions for auto-resizing text areas.

- Topic: Forms
- Type: property
- Browser support: Chrome 123+, Chrome Android 123+, Edge 123+, Firefox 152+, Firefox Android 152+, Safari 26.2+, Safari iOS 26.2+

## Example

Wrong:

```css
textarea {
  field-sizing: content;
}
```

Right:

```css
textarea {
  field-sizing: content;
  min-height: 3lh;
  max-height: 10lh;
}
```

The limits keep the textarea from collapsing when empty and from growing past the screen.

## Common mistakes

- An empty field without a placeholder shrinks to a tiny width.

## Key points

- Auto-growing fields use `field-sizing: content` instead of JavaScript that resizes on every input.
- `min-` and `max-` width or height limits are set, so the field neither collapses nor grows without end.

## Interview questions

### Does field-sizing work on input elements?

Yes. With `field-sizing: content`, a text `input` grows in width as the user types.

### What is the fallback when field-sizing is not supported?

The field keeps its fixed default size, so set a sensible `min-height` or `rows` that works either way.

## Related cards

- [`<textarea>`](https://wonderium.dev/html/textarea.md)
- [`<input>`](https://wonderium.dev/html/input.md)
- [min-height](https://wonderium.dev/css/min-height.md)
- [max-height](https://wonderium.dev/css/max-height.md)
- [resize](https://wonderium.dev/css/resize.md)

---

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