为什么下拉菜单不适用于这段代码?正在显示列表选项,但看起来“插入符号”无法正常工作。有什么想法吗?
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> Retrofit </title>
<link rel ="stylesheet" href ="css/bootstrap.min.css">
<link rel ="stylesheet" href ="css/main.css">
<meta name="viewport" content ="width = device-width, initial-scale = 1, user-scalable = no">
<script src ="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js " </script>
<script src ="js/bootstrap.min.js"></script>
</head>
<body>
<nav class ="navbar navbar-default navbar-fixed-top">
<div cass ="container">
<a href ="index.php" class ="navbar-brand"> Retrofit </a>
<ul class ="nav navbar-nav">
<li class ="dropdown ">
<a href ="#" class ="dropdown-toggle" data-toggle ="dropdown"> League <span class = "caret"></span></a>
<ul class ="dropdown-menu" role="menu">
<li><a href ="#"> Premier League </a></li>
<li><a href ="#"> La Liga </a></li>
<li><a href ="#"> Bundesliga </a></li>
<li><a href ="#"> Serie A </a></li>
</ul>
</li>
</ul>
</div>
</nav>
<?php
// put your code here
?>
</body>
</html>
答案 0 :(得分:1)
尝试将jquery放到正文的底部 像这样的东西
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>
</html>