Bootsrap下拉菜单不起作用

时间:2016-06-12 16:55:37

标签: html bootstrap-modal dropdown

 <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="css/bootstrap.css">
<script src="js/jquery.js"></script>
<script src ="js/bootstrap.js"></script>


</head>
<body>
<div class="dropdown">
    <button class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown" >Article <span class = "caret"></span></button>
    <ul class = "dropdown-menu">
        <li> <a href="#">Technology</a>s</li>
        <li><a href="#">Scienece</a>s</li>
        <li><a href="#">Scienece</a>s</li> 
    </ul>
</div>

</body>
</html>    

此代码中的引导程序存在问题,但我无法弄清楚,请帮帮我

2 个答案:

答案 0 :(得分:0)

现在正在工作,http://jsfiddle.net/MadhawaMB/xkL15guj/24/

您可以使用 Bootstrap CDN

     <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" ></script>

答案 1 :(得分:0)

我认为您添加的文件无法正常运行。 (css和js文件) 您可以在开发时使用/尝试使用外部链接。

这有效;

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>

<!-- Latest compiled and minified CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>


</head>
<body>
<div class="dropdown">
    <button class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown" >Article <span class = "caret"></span></button>
    <ul class = "dropdown-menu">
        <li> <a href="#">Technology</a>s</li>
        <li><a href="#">Scienece</a>s</li>
        <li><a href="#">Scienece</a>s</li> 
    </ul>
</div>

</body>
</html>