来自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">×</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>One fine body…</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>
可能导致这次崩溃的原因是什么?
答案 0 :(得分:0)
.modal
。你需要包含一个链接来打开模态..
<a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">