bootstrap模式不起作用,将此代码粘贴到文件中的哪里?

时间:2014-09-22 09:35:49

标签: html css twitter-bootstrap

下面提到的代码在我的项目中不起作用,modal没有在浏览器中显示。

<button class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm">No of items purchased</button>
         <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
           <div class="modal-dialog modal-sm">
             <div class="modal-content"><br>
                <h4>hi</h4>
             </div>
           </div>
         </div>

1 个答案:

答案 0 :(得分:0)

我认为你的代码是完美的,请检查你是否添加了bootstrap.js和bootstrap.css,还要检查这些文件是否有正确的链接并在调用bootstrap模式之前加载。即使我在解决这个问题时也应该记住一些事情。

1:检查是否提供了正确的链接以加载bootstrap.js和bootstrap.css

2:在加载bootstrap.js之前加载Jquery.js     bootstrap.css。

3:检查src的拼写,如果你是begainer         有时你会写scr而不是src。

4:检查您正在使用的引导程序版本。