如何保持所有子菜单始终位于顶部以及第一个?我试图插入一个容器,但我没有成功......
如果有类似话题,请原谅我,但我找不到具体问题。
我在这个例子中使用了引导程序。
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a href="#" class="brand">Project name</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a href="#">More options</a>
<ul class="dropdown-menu">
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
</ul>
</li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li class="nav-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
<form action="" class="navbar-search pull-left">
<input type="text" placeholder="Search" class="search-query span2">
</form>
<ul class="nav pull-right">
<li><a href="#">Link</a></li>
<li class="divider-vertical"></li>
<li class="dropdown">
<a class="#" href="#">Menu</a>
</li>
</ul>
</div><!-- /.nav-collapse -->
</div>
</div>
</div>
<hr>
<ul class="nav nav-pills">
<li class="active"><a href="#">Regular link</a></li>
<li class="dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu" id="menu1">
<li class="dropdown-submenu">
<a href="#">More options</a>
<ul class="dropdown-menu">
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
</ul>
</li>
<li class="dropdown-submenu"><a href="#">Another action</a>
<ul class="dropdown-menu">
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
<li><a href="#">Second level link</a></li>
</ul>
</li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#">Menu</a>
</li>
<li class="dropdown">
<a href="#">Menu</a>
</li>
</ul>
答案 0 :(得分:2)