Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make an input box and a button line up in bootstrap?

When using Twitter Bootstrap 2.1.0, and using HTML like this:

<div class="row">
    <div class="span10">
        <form data-bind="submit: AddDepartment">
            <input type="text" class="input-large" placeholder="Department Name" />
            <button type="submit" class="btn">Add</button>
        </form>
    </div>
</div>

The button doesn't line up with the textbox. You can see a jsFiddle of it here.

What is the proper Bootstrap way of getting them to line up?

like image 667
Brian McCord Avatar asked Dec 01 '25 09:12

Brian McCord


1 Answers

You need to place form-inline class in the form element like so:

<form data-bind="submit: AddDepartment" class="form-inline">

Here is an example: http://jsfiddle.net/SufMb/

like image 90
Phil Avatar answered Dec 03 '25 04:12

Phil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!