How can I make twitter bootstrap navbar fixed width, while keeping it centered?
I've tried adding a width parameter in .navbar, but then the navbar is misaligned.
.navbar {
overflow: visible;
margin-bottom: 20px;
color: #956362;
*position: relative;
*z-index: 2;
width: 650px;
}
I also tried
<div class="span6 offset3">
but this also makes it misaligned.
Surround it with a div. Give that div a fixed width.
Something like:
<div class="navbar-outer">
<div class="navbar">
<!--here goes the rest of the code-->
</div>
</div>
CSS:
.navbar-outer {
width:500px;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.