Difference between revisions of "Bootstrap navigation bar"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(Example)
Line 19: Line 19:
 
<pre>
 
<pre>
 
<nav>
 
<nav>
          <ul class="nav nav-pills pull-right">
+
<ul class="nav nav-pills pull-right">
            <li role="presentation" class="active"><a href="#">Home</a></li>
+
  <li role="presentation" class="active"><a href="#">Home</a></li>
            <li role="presentation"><a href="#">About</a></li>
+
  <li role="presentation"><a href="#">About</a></li>
            <li role="presentation"><a href="#">Contact</a></li>
+
  <li role="presentation"><a href="#">Contact</a></li>
          </ul>
+
</ul>
        </nav>
+
</nav>
 
</pre>
 
</pre>
  

Revision as of 03:56, 3 May 2016

In Bootstrap (framework), the navigation bar provides a responsive navigational menu.

Navigation bar and hamburger menu

On wider screens, the navigation bar displays at full width.

On narrow screen (mobile phones), the hamburger menu displays instead.

Requires Bootstrap CSS and JavaScript

Using the Bootstrap navigation bar requires both Bootstrap CSS and Bootstrap JavaScript.

Example

Here is the HTML for a typical navigation bar:

<nav>
 <ul class="nav nav-pills pull-right">
  <li role="presentation" class="active"><a href="#">Home</a></li>
  <li role="presentation"><a href="#">About</a></li>
  <li role="presentation"><a href="#">Contact</a></li>
 </ul>
</nav>

See also

External links

= General

= code.karljones.com