The default width for my navbar is too wide 1170px
. I would like to reduce it down to 940px
- but I want to keep the responsiveness.
I trie
just simple:
.navbar{
width:65% !important;
margin:0px auto;
left:0;
right:0;
padding:0;
}
or,
.navbar.navbar-fixed-top{
width:65% !important;
margin:0px auto;
left:0;
right:0;
padding:0;
}
Hope it works (at least, for future searchers)
I just solved this issue myself. You were on the right track.
@media (min-width: 1200px) {
.container{
max-width: 970px;
}
}
Here we say: On viewports 1200px or larger - set container max-width to 970px. This will overwrite the standard class that currently sets max-width to 1170px for that range.
NOTE: Make sure you include this AFTER the bootstrap.css stuff (everyone has made this little mistake in the past).
Hope this helps.. good luck!
Container widths will drop down to 940 pixels for viewports less than 992 pixels. If you really don’t want containers larger than 940 pixels wide, then go to the Bootstrap customize page, and set @container-lg-desktop
to either @container-desktop
or hard-coded 940px
.
If you are dealing with more dynamic screen resolution/sizes, instead of hardcoding the size in pixels you can change the width to a percentage of the media width as such
@media (min-width: 1200px) {
.container{
max-width: 70%;
}
}
The .navbar-static-top
you are using forces your navbar
to become full-width. Remove that class and you will get a resizable navbar
. Then, you can wrap it in a span#
of the size you want.
<div class="container">
<div class="row">
<div class="span6 offset3">
<div class="navbar">
...
</div>
</div>
</div>
Hello this working you try! in your case is .navbar-fixed-top{}
.navbar-fixed-bottom{
width:1200px;
left:20%;
}