— by Nesim


field-sizing: content in CSS allows you to control the size of input fields based on their content.

On inputs, it will only affect the width of the field. On textareas, it will affect both the width and height. On a select element, the width will shrink down to the width of the shortest option, but it will grow to the width of the selected option.

Session CodePen

See this Pen on CodePen.

Browser Support