1

I can't get Bootstrap to render a simple full width search input with the button right aligned. Here is my code:

<div class="row">
    <div class="col-md-12">
        <form class="form-inline">
            <input type="search" class="form-control" id="search" placeholder="I wish this would work...">
            <button type="button" class="btn btn-primary">Search</button>
        </form>
    </div>
</div>

All of this is wrapped in a container.

Sergej
  • 1,082
  • 11
  • 27
MoreScratch
  • 2,933
  • 6
  • 34
  • 65
  • Possible duplicate of [Bootstrap full-width text-input within inline-form](http://stackoverflow.com/questions/22774780/bootstrap-full-width-text-input-within-inline-form) – Steven B. Aug 01 '16 at 20:48

2 Answers2

0

Add pull-right into your class string

class="btn btn-primary pull-right"

0

You could try it like:

<div class="container">
  <form class="form-inline row">
    <div class="col-xs-8">
      <input type="search" class="form-control" id="search" placeholder="I wish this would work...">
    </div>
    <div class="col-xs-4">
      <button type="button" class="btn btn-primary btn-block">Search</button>
    </div>
  </form>
</div>

Here is a full example: https://jsfiddle.net/v8rm9nx4/3/

Sergej
  • 1,082
  • 11
  • 27