html Bootstrap 3模态

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html Bootstrap 3模态相关的知识,希望对你有一定的参考价值。

  <!-- Button trigger modal -->
  <a data-toggle="modal" href="#myModal1" class="btn btn-primary btn-lg">Launch demo modal</a>
  <!-- Instead of using href in the button link you can also use the data-target attribute and give it the same value. -->

  <!-- Modal -->
  <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
          <h4 class="modal-title">Modal title</h4>
        </div>
        <div class="modal-body">
          ...
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          <button type="button" class="btn btn-primary">Save changes</button>
        </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->
  
<!-- Notes 
  *Custom attributes like aria-labelledby and aria-hidden in the parent modal element are used for accessibility. 
  *Add a modifier class modal-lg to the modal-dialog div for a larger modal or modal-sm for a smaller modal.
  
  *To change the Modal position in the viewport you can target the Modal div id, in this example the id is myModal3
  #myModal3 {
    top:5%;
    right:50%;
    outline: none;
  }
  The modal is by default positioned using fixed positioning, so it is fixed to the dimensions of the viewport.
  -->
  

以上是关于html Bootstrap 3模态的主要内容,如果未能解决你的问题,请参考以下文章

模态框

angular-ui-bootstrap 模态框可以弹出多个吗

bootstrap 多按钮共用模态框传自定义参

Bootstrap 3 - 从另一个模式打开模式

bootstrap模态框怎么传值

bootstrap模态框中表单怎么提交表单