I have the following markup as a base:
<div>
<span>some dynamic text</span>
<input type="text" />
</div>
I want the input to be displayed in a line with the text (which is always a single line but varying in length) and consume the available width according to the text length. the markup can be changed if required. both elements should be 100% of the parent element’s width.
Two methods I can think of:
The first one:
You can simulate the behavior of a table using CSS;
HTML:
CSS:
Little demo: little link.
The second one:
This method relies on floating:
HTML:
CSS:
Another little demo: little link.