Bootstrap Center导航栏项目 [英] Bootstrap Center Navbar Items
本文介绍了Bootstrap Center导航栏项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道我可以将导航栏项目向左和向右推,但是如何将它们居中?
I know I can push navbar items to the left and right, but how would I center them?
text-align:center;
不起作用,也不是我想到的其他任何事情.
doesn't work nor any of the other things I thought of.
推荐答案
您将需要为Navbar组件修改一些CSS规则.因此,将类center
添加到nav.navbar
并遵循以下规则:
You will need to modify some CSS rules for Navbar component. So add a class center
to nav.navbar
and the following rules:
.navbar.center .navbar-inner {
text-align: center;
}
.navbar.center .navbar-inner .nav {
display:inline-block;
float: none;
}
Working demo (Bootstrap 3.3.7)
这篇关于Bootstrap Center导航栏项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文