记录的模态不在Bootstrap中显示

时间:2013-10-27 15:30:32

标签: twitter-bootstrap twitter-bootstrap-3

来自Twitter Bootstrap的Javascript documentation提供了以下示例:

<div class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Modal title</h4>
      </div>
      <div class="modal-body">
        <p>One fine body&hellip;</p>
      </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 -->

但是,我看不到任何内容:Chrome开发者工具指示封闭的div应该占用1140px xpp。我也尝试删除fade类,但没有用。

到目前为止,我没有遇到过测试其他组件的麻烦。我应该说我正在使用CDN进行测试,如下所示:

<!-- at the end of HEAD -->
    <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
<!-- at the end of BODY -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js">/script>

可能导致这次崩溃的原因是什么?

1 个答案:

答案 0 :(得分:0)

默认情况下隐藏

.modal。你需要包含一个链接来打开模态..

<a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">