我的模态没有显示

时间:2017-05-30 13:16:35

标签: modal-dialog bootstrap-modal

请告诉我为什么我的模态在bootstrap 3中没有显示



<button type="button" class="btn btn-default" data-toggle="modal" data-target="#myModal">Login</button>

<div class="fade modal" id="myModal" role="dialog" aria-labelledby="myModalLabel" aria-describedby="loginModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
</div>
<div class="modal-body">
tes
</div>
</div>
</div>
</div>
&#13;
&#13;
&#13;

这是我的引导程序中包含的css

&#13;
&#13;
    <link href="css/style.css" rel="stylesheet">
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/bootstrap-theme.css" rel="stylesheet">
&#13;
&#13;
&#13;

这是我的js include in my bootstrap

&#13;
&#13;
   <script src="js/bootstrap.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/docs.min.js"></script>
    
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="js/ie10-viewport-bug-workaround.js"></script>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

试试这个:包括Jquery,Bootstrap JS&amp; CSS

Example

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

    <div class="container">
      <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>

      <div class="modal fade" id="myModal" role="dialog">
        <div class="modal-dialog">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4 class="modal-title"> Header</h4>
            </div>
            <div class="modal-body">
              <p>Some text.</p>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
          </div>

        </div>
      </div>

    </div>