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.
Syntax
/* 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;
field-sizing Browser support
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+