Is it possible to make input element fit-content with css?
Hi guys, I wonder if it is possible to make input element fit-content with CSS (I'm using tailwind css)? I tried, but it does not work
2 Replies
You could try the new field-sizing property (
field-sizing-content
in Tailwind 4) but this is not supported by all browsers yet.MDN Web Docs
field-sizing - CSS: Cascading Style Sheets | MDN
The field-sizing CSS property enables you to control the sizing behavior of elements that are given a default preferred size, such as form control elements. This property enables you to override the default sizing behavior, allowing form controls to adjust in size to fit their contents.
It seems to work fine in my case
but this is not supported by all browsers yet
ðŸ˜