Generally, you don’t make the length of the box adapt to the content, because you don’t know how many words the user will input. What if it is 1,000 words, will you keep making it wider?
Generally, the width is a small value when the user is not inputting
When the user is ready to input, the input box stretches to a value
Generally, you don’t make the length of the box adapt to the content, because you don’t know how many words the user will input. What if it is 1,000 words, will you keep making it wider?
Generally, the width is a small value when the user is not inputting
When the user is ready to input, the input box stretches to a value
There is currently no way to achieve this with CSS, even using calc and css variables
html5 attributes
contenteditable
can achieve what you want through max-width min-widthThere are also strange needs like this. If you are like this, it is best to use min-width and max-width to control the range.