中心Navbar在Twitter Bootstrap 2.0 [英] Center Navbar in Twitter Bootstrap 2.0
本文介绍了中心Navbar在Twitter Bootstrap 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我们使用Twitter Bootstrap 2.0为导航栏添加了以下标记。
Suppose we have the following markup for navigation bar using Twitter Bootstrap 2.0.
<div class="navbar navbar-fixed-top">
<div class="navbar-inner pull-center">
<ul class="nav">
<li class="active"><a href="#">HOME</a></li>
<li><a href="#contact">CONTACT</a></li>
</ul>
</div>
</div>
中心 .nav
navbar-inner
?
我只想出了添加自己的CSS样式:
I only came up with adding my own CSS styles:
@media (min-width: 980px) {
.pull-center {
text-align: center;
}
.pull-center > .nav {
float:none;
display:inline-block;
*display: inline; *zoom: 1;
height: 32px;
}
}
推荐答案
导航栏中容器的宽度从 auto
到 960px
。
Override the width of the container within the navbar from auto
to 960px
.
.navbar-inner .container {width:960px;}
这篇关于中心Navbar在Twitter Bootstrap 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文