为什么我的`class =" modal"`不起作用,但当我使用`class =" collapse"`它的工作原理

时间:2015-01-21 21:11:00

标签: html twitter-bootstrap

输出总是淡出,但模态/形式不显示。

这是我的代码

<link rel="stylesheet" href="bootstrap/css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="bootstrap/fonts/glyphicons-halflings-regular.eot" type="text/css" />`

<script src="bootstrap/js/jquery.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>

<li><button  type="button" class="btn btn-success btn-lg btn-block" data-toggle="modal" data-target=".bs-example-modal-lg">Add</button></li>


<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
    ...sadsadsadsadsada
</div>
</div>
</div>

1 个答案:

答案 0 :(得分:0)

我认为你错过了模态的id,记住按钮的目标模式由它的id:

<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">Launch demo modal</button>
<!-- Modal -->
<div class="modal fade" id="myModal"...