0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-30 12:24:19 +01:00
Bootstrap/docs/components/navbar.md
2014-10-27 04:52:22 -07:00

4.3 KiB

layout title
page New navbar

The navbar is a simple wrapper for positioning branding, navigation, and other elements. It's easily extensible and with the help of our collapse plugin it can easily integrate offscreen content.

Basics

Here's what you need to know before getting started with the navbar:

  • Navbars require a wrapping .navbar and either a color scheme class or custom styles.
  • When using multiple components in a navbar, some alignment classes are required.
  • Navbars and their contents are fluid by default. Use optional containers to limit their horizontal width.

Branding

Name your company, product, or project with .navbar-brand.

{% example html %}

{% endexample %}

Navigation

Use .nav-pills within a navbar for basic navigation.

{% example html %}

{% endexample %}

Inline forms

Add an .inline-form within the navbar with nearly any combination of form controls and buttons.

{% example html %}

Search
{% endexample %}

Containers

Although it's not required, you can wrap a navbar in a .container or add one within for basic horizontal control.

{% example html %}

{% endexample %}

{% example html %}

{% endexample %}

Alignment

Use .pull-left or .pull-right to align multiple elements within the navbar.

{% example html %}

{% endexample %}

Inverse color scheme

Replace .navbar-default with .navbar-inverse for a darker background color and white text.

{% example html %}

{% endexample %}

Collapsible content

Our collapse plugin allows you to use a <button> to toggle hidden content.

{% example html %}

Collapsed content

Toggleable via the navbar brand.

{% endexample %}