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-justifiednow plays nice with navbar-nav:

nav-justifiednow使用navbar-nav玩得很好:

<ul class="nav navbar-nav nav-justified">

See updated jsFiddle.

查看更新的jsFiddle。

更多相关文章

  1. PHP之依赖注入容器pimple
  2. JqueryUI Draggable - 仅自动垂直调整父容器大小
  3. 如何修复一个页面网站的容器/正文宽度(html,css和js)
  4. 扩展子div时如何扩展容器div的高度
  5. PyGobject(五十六)布局容器之TreeView(上)
  6. Java 容器源码分析之 TreeMap

随机推荐

  1. MyEclipse10 配置 Android SDK 时遇到的
  2. [AndroidTips]Declaring a custom androi
  3. 最新eclipse中android插件安装下载地址
  4. Android带返回值的窗口跳转
  5. android edittext 去边框 去下划线
  6. Android全透明Activity示例
  7. appium測試中验证toast的正确性
  8. Android压缩
  9. 代码中如何设置TextView为不可见
  10. Android判断当前线程是否是主线程的方法