bootstrap崩溃不起作用

时间:2016-09-01 18:43:48

标签: twitter-bootstrap

嘿我尝试使用bootstrap来创建一些下拉和折叠,但它根本不起作用。单击时,所显示的内容不会显示。即使我直接从w3学校复制代码。究竟是什么问题?我将jQuery下载并保存在同名文件夹中作为我的html文件。

                         <head>
    <script src="jQuery.js"></script>
    <script src="bootstrap.js"></script>
    <link rel="stylesheet" href="bootstrap.css">
    <title>Bootsrap</title>
    <meta charset="UTF-8">
</head>

             <button data-toggle="collaspe" data-  target="#demo">Collapsible</button>
        <div id="demo" class="collapse">
            some will say that the way to go about doing some of the real things is by
            doing it by the book to avoid some of the boring things that are said in the 
            latter age of the new and humble heritage of the monk of the new age.
        </div>

我实际上将bootstrap css和js导入到我的html加jquery的同名文件夹中。

2 个答案:

答案 0 :(得分:2)

错字。将data-toggle="collaspe"更改为data-toggle="collapse",并确保<button>type="button"

<button type="button" data-toggle="collapse" data-target="#demo">Collapsible</button>
<div id="demo" class="collapse">
  some will say that the way to go about doing some of the real things is by
  doing it by the book to avoid some of the boring things that are said in the 
  latter age of the new and humble heritage of the monk of the new age.
</div>

<强> Bootply

答案 1 :(得分:0)

你是否在bootstrap js之前包含了jquery js?

在您的浏览器控制台(开发人员工具)中,您是否可以看到这些文件包含正确?