CSS field-sizing: content Playground

Wulan takes orders on two form controls: the stiff one field-sizing: fixed, the hanging one on your CSS, and the sizes the browser measures show where the…

Why it matters

Comment boxes, chats, bios, tag inputs: all of them want to follow their content. The JS version is boilerplate and easy to get wrong (a forgotten border, jumps while typing). field-sizing does it in the browser’s layout, and works for <input> and <select> too.

The key idea

A form control's natural size moves from its attributes to its content

Common mistakes

Try it in this playground