10

我目前正在从 bootstrap 2 切换到 Bootstrap 3。如何在 Bootstrap 3 中将输入字段居中?文本正确居中。它曾经适用于BS2。我尝试在 div 中移动 'style='text-align:center' 但仍然没有运气。

JSfiddle

更新了答案的小提琴

    <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="johndoe@yahoo.com"  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>
4

1 回答 1

13

margin: 0 auto;

对于输入元素

于 2013-09-09T18:33:11.197 回答