Jess McKenzie Jess McKenzie - 6 months ago 14
HTML Question

Bootstrap 3 Checkbox Label

How can I add a label to my checkbox's so that I can have them inline.

I am wanting it like this:

label input input


Currently the code below is showing like
input input label
why?

HTML:

<div class="col-md-6 pull-right">
<div class="form-group">
<label>Gender</label> <label class=
"col-sm-2 checkbox-inline"><input id="genMale" type="checkbox"
value="genMale">Male</label> <label class=
"col-sm-2 checkbox-inline"><input id="genFemale" type=
"checkbox" value="genFemale">Female</label>
</div>

Answer

The gender label is not within the grid. Add the class col-sm-2 to the label.

<label class="col-sm-2">Gender</label>

JSFIDDLE

Comments