繁体   English   中英

如何使Twitter Bootstrap导航栏固定宽度?

[英]how to make twitter bootstrap navbar fixed width?

如何使Twitter Bootstrap导航栏固定宽度,同时保持其居中状态?

我尝试在.navbar中添加width参数,但是随后导航栏未对齐。

.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;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM