CSS variable width element to fill in space

Posted by Gary Volland on Stack Overflow See other posts from Stack Overflow or by Gary Volland
Published on 2010-06-05T14:23:22Z Indexed on 2010/06/05 15:02 UTC
Read the original article Hit count: 227

Filed under:
|
|
|

In a form, I would like the input:text to fill the remain space after the label to the form is left and right justified.

The label have number of characters so I can't set a fixed width on the label.

Code example:

<fieldset>
<legend>User Info</legend>
<p><label>First Name :</label><input type="text"...></p>
<p><label>Last Name : </label><input type="text"...></p>
<p><label>Completed Email Address :</label><input type="text"...></p>
</fieldset>

How can I style the input to fill the remaining space after the text.

Thanks.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about css