我有一个导航栏,里面有 4 个元素。第一个只是一个主页链接,第二个和第三个有下拉菜单,第四个是用下拉菜单向右拉的。
现在第二个和第三个元素的下拉菜单总是出现在第一个菜单项下,而不是在单击的菜单项下。
第四个没有这个问题,我做错了什么?
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#"><span class="blue">art</span><span class="black">ly.de</span></a>
<div class="pull-right">
<ul class="nav">
<li class="divider-vertical"></li>
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-user"></i> Patrick Fraley
<span class="icon-caret-down"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#"><i class="icon-edit"></i> Profile</a></li>
<li><a href="#"><i class="icon-cog"></i> Account Settings</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-signout"></i> Sign Out</a></li>
</ul>
</li>
</ul>
</div>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Dashboard</a></li>
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Elements
<span class="icon-caret-down"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">Calendar</a></li>
<li><a href="#">Forms</a></li>
<li><a href="#">Graphs</a></li>
<li><a href="#">Tables</a></li>
<li><a href="#">Typography</a></li>
</ul>
</li>
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Pages
<span class="icon-caret-down"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">Login</a></li>
<li class="divider"></li>
<li><a href="#">Error 404</a></li>
<li><a href="#">Error 500</a></li>
</ul>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>