Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap 3 show label in inline selectbox

I set label for select box menu in bootstrap 3 like this :

<div class="col-lg-2">
    <label>Filter</label>
        <select class="form-control" name="sort">
            <option value="1">1</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
        </select>
</div>

in output in see label in top of select box menu: enter image description here

I need to show label inline of select box menu like this :

enter image description here

how do show label in inline ?!

DEMO JSFIDDLE

like image 553
Eric Favoni Avatar asked Oct 01 '14 15:10

Eric Favoni


1 Answers

You need put your label and your select inside of a "group", so we have this:

<div class="form-group">
    <label for="sort" class="col-sm-2 control-label"> Filter </label>
    <div class="col-sm-10">
        <select class="form-control" name="sort" id="sort">
            <option value="1">1</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
        </select>
     </div>
</div>
like image 159
Zanoldor Avatar answered Nov 03 '22 09:11

Zanoldor