Make a text and select dropdown horizontal

Viewed 740

I am trying to make a text like label and select dropdown in the same line. When I use display: inline for both divs it works. But when I use form-control class in select it breaks. Here is the example

enter image description here

Here is the code

<div class="col-md-2">
  <div> <span>test</span></div>

  <div>
    <select class="form-control" id="sel1">
      <option>1</option>
      <option>2</option>
      <option>3</option>
      <option>4</option>
    </select>
  </div>
</div>

I want to make it in same line.

4 Answers
<div class="form-horizontal">
<label>Country</label>
<select>
<option>Nepal</option>
<option>India</option>
<option>China</option>
</select>

Note: form-horizontal class of bootstrap will keep both in the same line.

Related