如何使 twitter bootstrap 导航栏固定宽度,同时保持居中?
我尝试在 .navbar 中添加宽度参数,但导航栏未对齐。
.navbar {
overflow: visible;
margin-bottom: 20px;
color: #956362;
*position: relative;
*z-index: 2;
width: 650px;
}
我也尝试过
<div class="span6 offset3">
但这也会导致其错位。
最佳答案
用 div 包围它。 给该 div 一个固定的宽度。
类似于:
<div class="navbar-outer">
<div class="navbar">
<!--here goes the rest of the code-->
</div>
</div>
CSS:
.navbar-outer {
width:500px;
}
关于css - 如何使 twitter bootstrap 导航栏固定宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13780471/