Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you do not want your navbar links to be collapsed on smaller devices, then you need to remove the <code>&lt;div class="nav-collapse collapse"&gt;</code> element.</p> <p>The basic structure should look something like this....</p> <pre><code>&lt;div class="navbar navbar-inverse navbar-fixed-top"&gt; &lt;div class="navbar-inner"&gt; &lt;a class="brand" href="#"&gt;Title&lt;/a&gt; &lt;ul class="nav"&gt; &lt;li class="active"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>If you want to keep the responsive functionality, then add the below code to within you <code>container</code> div. This will give you a button to toggle the collapsed menu on smaller devices. </p> <pre><code> &lt;a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/a&gt; </code></pre> <p>So then the end result would look something like this.</p> <pre><code>&lt;div class="navbar navbar-inverse navbar-fixed-top"&gt; &lt;div class="navbar-inner"&gt; &lt;div class="container"&gt; &lt;!-- .btn-navbar is used as the toggle for collapsed navbar content --&gt; &lt;a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/a&gt; &lt;!-- Be sure to leave the brand out there if you want it shown --&gt; &lt;a class="brand" href="#"&gt;Project name&lt;/a&gt; &lt;!-- Everything you want hidden at 940px or less, place within here --&gt; &lt;div class="nav-collapse collapse"&gt; &lt;!-- .nav, .navbar-search, .navbar-form, etc --&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Also, you do not have to nest a <code>&lt;ul class="nav"&gt;</code> element within a <code>&lt;ul class="nav"&gt;</code> element for the dropdown menus. The correct structure for you navigation items should look like this. </p> <pre><code>&lt;ul class="nav"&gt; &lt;li class="active"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt; &lt;li class="dropdown"&gt; &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt; Test &lt;b class="caret"&gt;&lt;/b&gt; &lt;/a&gt; &lt;ul class="dropdown-menu"&gt; ... &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload