field-sizing

A modern property that allows form fields (like textareas) to automatically grow or shrink based on the amount of text typed into them, without needing JavaScript.

It is documented as part of the CSS Basic User Interface specification.

/* Usage Example */
textarea {
  /* Textarea will grow automatically as the user types */
  field-sizing: content;
  min-height: 3em;
}

/* Syntax */
field-sizing: content;
field-sizing: fixed;

/* Global values */
field-sizing: inherit;
field-sizing: initial;
field-sizing: revert;
field-sizing: revert-layer;
field-sizing: unset;

This comparison shows how field-sizing works in a real project. View snippet →

Limited availability Since 2020 75% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

123+
26.2+
123+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC