The default input element is size = "20" if it is not defined on the line or is assigned a CSS style rule.
How do you make the default actual size of the value? For other items:
<div style="display: inline; width: auto;"> The box will only fit the width of it content </div>
width: auto is all you need. I can not set a specific width, as the value may be larger. For instance:
<input id="short" type="text" value="1000" /> <input id="long" type="text" value=" Areally long name is in this input field." />
I want #short to be 1000 in size (essentially size = "4" + padding), but #long should be as long as necessary. These inputs come in software, so I canβt just put a short class on the one I need and a long class on the one I want for a long time. I would really like it if I could put:
input { width: auto; }
Anyway to do this?
source share