如何制作菜单、导航栏 nav-pills nav-stacked 折叠 Twitter-bootstrap 3.0
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18856533/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to make menu, navbar nav-pills nav-stacked collapse Twitter-bootstrap 3.0
提问by Filip Luká?
I have this code, I want to make this menu collapse for mobile-devices
我有这个代码,我想让这个菜单为移动设备折叠
<nav class="navigation">
<ul class="nav nav-pills nav-stacked" id="nav-menu">
<li class="active" ><a href="index.php">Domov</a></li>
<li><a href="#">Koncerty</a></li>
<li><a href="#">Shop</a></li>
<li><a href="#">Download</a></li>
<li><a href="#">Kontakty</a></li>
<li><a href="#">Troll</a></li>
</ul>
</nav>
And I want to do this:
我想这样做:
回答by Scott Swezey
I've found a similar question, which seems to have a detailed answer that will be useful for you. It didn't work perfectly for me, but it does seem much closer than I was before.
我发现了一个类似的问题,它似乎有一个对您有用的详细答案。它对我来说并不完美,但它似乎比我以前更接近。
Check it out: makes nav-pills collapsable just like nav-bar in bootstrap
回答by Pallab
Try the following code. This should help you. I assume what you need from the reference link you provided. Though that site I guess is not using bootstrap.
试试下面的代码。这应该对你有帮助。我从您提供的参考链接中假设您需要什么。虽然我猜那个网站没有使用引导程序。
<nav class="navbar navbar-default" role="navigation">
<div class="">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
You should get more help from docs
您应该从文档中获得更多帮助


