Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to center input in a Bootstrap 3 modal?

I'm currently switching over to Bootstrap 3 from bootstrap 2. How do you center the input field in Bootstrap 3? The text centers correctly. It used to work for BS2. I have tried moving the 'style='text-align:center' in div's but still no luck.

JSfiddle

Updated fiddle with answer

    <div id="Email_Alert_Modal" class="modal show" tabindex="-1" role="dialog" data-keyboard="false" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">

            <div class="modal-header" style="text-align: center">
               <h3>Email Alert</h3>
            </div>

            <div class="modal-body"  style="text-align: center">
                    <h4>Please enter email address that the alert will be sent to.</h4>
                    <label  for="send_email"> </label> <input style="width:200px" type="email"  class="form-control" name="email" id="send_email" placeholder="[email protected]"  title="Input Email Address">
            </div>

            <div class="modal-footer">
              <button class="btn btn btn-primary" onclick='Email_Alert()' >Send</button>
              <button class="btn btn btn" data-dismiss="modal" >Cancel</button>
            </div>
        </div>
    </div>
</div>
like image 355
fat fantasma Avatar asked Sep 09 '13 18:09

fat fantasma


1 Answers

Set

margin: 0 auto;

for input element

like image 105
Jakub Matczak Avatar answered Sep 18 '22 23:09

Jakub Matczak