When I have a set of Span elements in a container, they are stacked from left to right (and go to the next line when necessary), and more importantly, the width of each of them is automatically set based on how much content is in them.
Is there a way to achieve a similar effect with textfield elements (that have initial values) instead of spans? The automatically adjusted widths is crucial, i.e. I want the textfields to be as wide as their initial values require. I know this can be achieved to some extent in JS, but I prefer a CSS solution.
(I've looked at other questions, but they all seem to target the cases where the textfield width is supposed to change dynamically, not to be set based on the initial value.)