I'm trying to unstyle an input element so that its text looks like plain/inline-text, and I've reset pretty much every css property it can have, but I can't get the input's width to adjust/shrink to its content (input { width:auto; min-width:0; }
does not work). It obeys an arbitrary width like input { width: 10px; }
, so obviously its width is adjustable.
I see people trying to do it with javascript (the fiddle from the answer doesn't work anymore), so I'm wondering if what I want is even possible.
Here's a fiddle.
Played with this. Couldn't do it. What are you trying to achieve? Are you aware of the contenteditable
attribute?
This might get you what you need.
https://developer.mozilla.org/en-US/docs/HTML/Content_Editable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With