Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

container inside a navbar in twitter bootstrap

I have a following navbar code using twitter bootstrap

<div class="navbar navbar-inverse">
  <div class="navbar-inner">
    <div class="container">
      <ul class="nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#">Link</a></li>
        <li><a href="#">Link</a></li>
      </ul>
    </div>
  </div>
</div>

and the output is With original bootstrap When I remove "width: auto" from ".navbar .container{width:auto}" in bootstap.css the output becomes After the hack and is the output I am expecting.

https://github.com/twitter/bootstrap/issues/2093 shows "width: auto" as an intended feature.What am I doing wrong here?

like image 454
Jayesh Avatar asked Dec 10 '12 10:12

Jayesh


People also ask

Does navbar go in container?

navbar element that means it must sit outside the container, as this example shows: [https://getbootstrap.com/examples/carousel/]. So use a container where you want to set max width and make sure the grid system works.

How do you make a navbar collapsible?

To create a collapsible navigation bar, use a button with class="navbar-toggler", data-toggle="collapse" and data-target="#thetarget" . Then wrap the navbar content (links, etc) inside a div element with class="collapse navbar-collapse" , followed by an id that matches the data-target of the button: "thetarget".

What is collapse in navbar?

Introduction to Bootstrap Collapse Navbar. Navigation bar (Navbar) is a header or index of the web application. It is always placed on top of the web page. The collapse in bootstrap is used for space-saving of large content. It is hidden and shows the content when the user wants.

What is a toggler in Bootstrap?

Bootstrap switch/toggle is a simple component used for activating one of two predefined options. Commonly used as an on/off button. It's mostly used in a number of various forms since they are very simple to use and cut the time one needs to fill all the inputs. Examples of Bootstrap switch use: Forms.


1 Answers

<div class="navbar navbar-static-top navbar-inverse">
  <div class="navbar-inner">
    <div class="container">
      <ul class="nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#">Link</a></li>
        <li><a href="#">Link</a></li>
      </ul>
    </div>
  </div>
</div>

This should do it

like image 121
Justin King Avatar answered Oct 05 '22 23:10

Justin King