我想在我的网站上提供一个下拉菜单,但由于某种原因这个下拉菜单不起作用。我无法找出原因。我的代码是这样的:
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">More Categories <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">category1</a></li>
<li><a href="#">category2</a></li>
<li><a href="#">category3</a></li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
我的 li 部分标记为红色的网页快照:
我在外面做这些东西有什么错误吗?这里使用的 css 文件是来自 bootstrap 官方网站的 bootstrap.min.css。 编辑:
<!--core CSS -->
<link href="bootstrap.min.css" rel="stylesheet">
<link href="categories.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="buysell.css" rel="stylesheet">
<script src="ie-emulation-modes-warning.js"></script>
<script type="text/javascript">
$('.dropdown-toggle').dropdown()
</script>
这是我的 Bootstrap 包含部分。
最佳答案
关于html - 为什么下拉菜单不能正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29438004/