如何将这些Twitter bootstrap 3导航栏链接集中在一起?
I'm wondering on how I can center the bootstrap 3's navbar menu items. I know they have included a .nav-justified
class but that will just conflict with navbar-nav
if used together. I belive it is being looked into by the dev team.
我想知道如何将bootstrap 3的导航栏菜单项置于中心位置。我知道他们已经包含了一个.nav-justified类,但如果一起使用,它将与navbar-nav冲突。我相信开发团队正在调查它。
So is there any work around with CSS that I can achieve a navbar that will keep the navbar menu items/links justified even when the container it is in is re-sized.
因此,有任何关于CSS的工作,我可以实现一个导航栏,即使在重新调整其容器的大小时,也会保持导航栏菜单项/链接的合理性。
Here's a Jsfiddle for you if you need it.
如果您需要,这里有一个Jsfiddle。
2 个解决方案
#1
28
The .nav-justifed
class is to be used with nav-tabs
/ nav-pills
(see bootstrap docs) and not nav-bar
. The two concepts are very different and should not be confused.
.nav-justifed类将与nav-tabs / nav-pills一起使用(参见bootstrap docs)而不是nav-bar。这两个概念非常不同,不应混淆。
However, you can achieve the effect you are looking for by adding the following css
:
但是,您可以通过添加以下css来实现您正在寻找的效果:
.navbar-nav.nav-justified > li{
float:none;
}
nav-justified
now plays nice with navbar-nav
:
nav-justifiednow使用navbar-nav玩得很好:
<ul class="nav navbar-nav nav-justified">
See updated jsFiddle.
查看更新的jsFiddle。
更多相关文章
- PHP之依赖注入容器pimple
- JqueryUI Draggable - 仅自动垂直调整父容器大小
- 如何修复一个页面网站的容器/正文宽度(html,css和js)
- 扩展子div时如何扩展容器div的高度
- PyGobject(五十六)布局容器之TreeView(上)
- Java 容器源码分析之 TreeMap