<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/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.7/js/bootstrap.min.js"></script>
<li class="dropdown">
<a class=dropdown-toggle data-toggle=dropdown href="#">
<i class=material-icons>Button</i>
</a>
<ul class="dropdown-menu dropdown-messages">
<li><a href="profile"><i class=ti-user></i> Profile</a></li>
<li><a href="logoutGeneral"><i class=ti-layout-sidebar-left></i> Logout</a></li>
</ul>
</li>
即使缩小浏览器,浏览器中的所有功能都可以正常工作。但是,当我尝试单击子菜单时,HREF不起作用,只关闭它没有重定向的下拉菜单......
答案 0 :(得分:0)
这是制作bootstrap 3.3.7下拉按钮的官方正确方法
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Dropdown
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="test.html">Action</a></li>
<li><a href="another-test.html">Another Link</a></li>
</ul>
</div>
参考bootstrap 3 - drop-down button
并在关闭body标签之前加载js文件。工作demo