Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Center button under form in bootstrap

i have some problems with Bootstrap. i centered form and button by using span6 offset3 and don't know how to center button under this form right now. i tried with text-align: center but still it's more on the left.

<div class="container">
    <div class="row">
        <div class="span6 offset3">
            <form>
                <input class="input-xxlarge" type="text" placeholder="Email..">
                <p style="line-height: 70px; text-align: center;"><button type="submit" class="btn">Confirm</button></p>
            </form>
        </div>
    </div>
</div>

like image 719
Fastkowy Avatar asked Apr 07 '13 20:04

Fastkowy


1 Answers

You can use this

<button type="submit" class="btn btn-primary btn-block w-50 mx-auto">Search</button>

Look something like this enter image description here

Complete Form code -

<form id="submit">
    <input type="text" class="form-control mt-5" id="search-city" 
           placeholder="Search City">
    <button type="submit" class="btn btn-primary mt-3 btn-sm btn-block w-50 
            mx-auto">Search</button>
   </form>
like image 67
Vansh Bhardwaj Avatar answered Sep 28 '22 01:09

Vansh Bhardwaj