如何将模态标题置于Bootstrap中

时间:2018-05-17 14:48:53

标签: bootstrap-4

我正试图将模态标题的h5集中在bootstrap中。 在教程中,我看到它足以设置

h5.modal-title{
margin: auto;
}

它在视频中看起来很完美。(他们使用了Bootstrap4测试版) 但是当我这样做时,它看起来像这样: https://i.stack.imgur.com/iYu7O.png

      

  <!-- Modal -->
  <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          ...
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
          <button type="button" class="btn btn-primary">Save changes</button>
        </div>
      </div>
    </div>
  </div>

0 个答案:

没有答案