Twitter Bootstrap - Inline Form
15,726
Bootstraps has a few example form layouts that you can use here.
As per their documentation, use controls-row
when you want multiple on a line. (form-inline
is for the whole form to be inline). You will want to read their scaffolding documentation before going forward with using their classes.
Updated jsfiddle
PS.. HTML pointers
- Don't duplicate
id
(andname
if you can avoid it). For example,id="textinput"
should be unique across the entire page. Thename
doesn't have to be unique, but it's best practice to just match the id. - Add
for
attribute to labels.
Comments
-
maximus almost 2 years
I have this form:
<!-- First Name--> <div class="control-group"> <label class="control-label">First Name</label> <div class="controls"> <input id="textinput" name="Product Name" class="input-xlarge" type="text"> </div> </div> <!-- Last Name--> <div class="control-group inline"> <label class="control-label">Last Name</label> <div class="controls"> <input id="textinput" name="Product Name" class="input-xlarge" type="text"> </div> </div> <!-- Telefonnumber--> <div class="control-group"> <label class="control-label">Telefonnumber</label> <div class="controls"> <input id="textinput" name="Product Name" class="input-xlarge" type="text"> </div> </div> <!-- Street--> <div class="control-group"> <label class="control-label">Street</label> <div class="controls"> <input id="textinput" name="Product Name" class="input-xlarge" type="text"> </div> </div>
I want to display Last Name next to First Name and under these two field the Telefonnumber.
How can I realize this in twitter bootstrap?
btw the jsfiddle