2014-03-17 03:03:53 +01:00
< div class = "bs-docs-section" >
< h1 id = "nav" class = "page-header" > Navs< / h1 >
2014-07-10 01:04:31 +02:00
< p class = "lead" > Navigation available in Bootstrap share general markup and styles, from the base < code > .nav< / code > class to the active and disabled states. Swap modifier classes to switch between each style.< / p >
2014-03-17 03:03:53 +01:00
2014-07-10 01:04:31 +02:00
< h2 id = "nav-base" > Base nav< / h2 >
< p > Roll your own navigation style by extending the base < code > .nav< / code > component. All Bootstrap's nav components are built on top of this. Includes styles for the disabled state, but < strong > not the active state< / strong > .< / p >
2014-07-10 05:00:22 +02:00
{% example html %}
2014-07-10 01:04:31 +02:00
< ul class = "nav" role = "tablist" >
< li class = "nav-item" >
< a class = "nav-link" href = "#" > Link< / a >
< / li >
< li class = "nav-item" >
< a class = "nav-link" href = "#" > Link< / a >
< / li >
< li class = "nav-item" >
< a class = "nav-link" href = "#" > Another link< / a >
< / li >
< li class = "nav-item disabled" >
< a class = "nav-link" href = "#" > Disabled< / a >
< / li >
< / ul >
2014-07-10 05:00:22 +02:00
{% endexample %}
2014-07-10 01:04:31 +02:00
< p > Classes are used so your markup can be super flexible.< / p >
< div class = "bs-example" >
< nav class = "nav" role = "tablist" >
< a class = "nav-link active" href = "#" > Active< / a >
< a class = "nav-link" href = "#" > Link< / a >
< a class = "nav-link" href = "#" > Another link< / a >
< a class = "nav-link disabled" href = "#" > Disabled< / a >
< / nav >
< / div >
{% highlight html %}
< nav class = "nav" role = "tablist" >
< a class = "nav-link active" href = "#" > Active< / a >
< a class = "nav-link" href = "#" > Link< / a >
< a class = "nav-link" href = "#" > Another link< / a >
< a class = "nav-link disabled" href = "#" > Disabled< / a >
< / nav >
{% endhighlight %}
2014-07-09 22:51:20 +02:00
2014-03-17 03:03:53 +01:00
< h2 id = "nav-tabs" > Tabs< / h2 >
2014-07-10 01:04:31 +02:00
< p > Takes the basic nav from above and adds the < code > .nav-tabs< / code > class to generate a tabbed interface.< / p >
2014-03-17 03:03:53 +01:00
< div class = "bs-example" >
2014-07-10 01:04:31 +02:00
< ul class = "nav nav-tabs" role = "tablist" >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item active" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Active< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Link< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Another link< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item disabled" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Disabled< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-03-17 03:03:53 +01:00
< / ul >
< / div >
{% highlight html %}
2014-07-10 01:04:31 +02:00
< ul class = "nav nav-tabs" role = "tablist" >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item active" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Active< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Link< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Another link< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item disabled" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Disabled< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-03-17 03:03:53 +01:00
< / ul >
{% endhighlight %}
< div class = "bs-callout bs-callout-info" >
< h4 > Requires JavaScript tabs plugin< / h4 >
< p > For tabs with tabbable areas, you must use the < a href = "../javascript/#tabs" > tabs JavaScript plugin< / a > .< / p >
< / div >
< h2 id = "nav-pills" > Pills< / h2 >
< p > Take that same HTML, but use < code > .nav-pills< / code > instead:< / p >
< div class = "bs-example" >
2014-07-10 01:04:31 +02:00
< ul class = "nav nav-pills" role = "tablist" >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item active" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Active< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Link< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Another link< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item disabled" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Disabled< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-03-17 03:03:53 +01:00
< / ul >
< / div >
{% highlight html %}
2014-07-10 01:04:31 +02:00
< ul class = "nav nav-pills" role = "tablist" >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item active" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Active< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Link< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Another link< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item disabled" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Disabled< / a >
2014-07-09 04:00:48 +02:00
< / li >
2014-03-17 03:03:53 +01:00
< / ul >
{% endhighlight %}
2014-07-09 04:00:48 +02:00
2014-07-10 01:04:31 +02:00
< h2 id = "nav-pills-stacked" > Stacked pills< / h2 >
< p > Just add < code > .nav-stacked< / code > .< / p >
2014-03-17 03:03:53 +01:00
< div class = "bs-example" >
2014-07-10 01:04:31 +02:00
< ul class = "nav nav-pills nav-stacked" role = "tablist" >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item active" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Active< / a >
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Link< / a >
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Another link< / a >
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item disabled" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Disabled< / a >
< / li >
2014-03-17 03:03:53 +01:00
< / ul >
< / div >
{% highlight html %}
2014-07-08 04:22:00 +02:00
< ul class = "nav nav-pills nav-stacked" role = "tablist" >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item active" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Active< / a >
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Link< / a >
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Another link< / a >
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item disabled" >
2014-07-10 01:04:31 +02:00
< a href = "#" class = "nav-link" > Disabled< / a >
< / li >
2014-03-17 03:03:53 +01:00
< / ul >
{% endhighlight %}
< h2 id = "nav-dropdowns" > Using dropdowns< / h2 >
< p > Add dropdown menus with a little extra HTML and the < a href = "../javascript/#dropdowns" > dropdowns JavaScript plugin< / a > .< / p >
< h3 > Tabs with dropdowns< / h3 >
< div class = "bs-example" >
2014-05-10 00:05:20 +02:00
< ul class = "nav nav-tabs" role = "tablist" >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item active" >
2014-07-10 01:08:18 +02:00
< a href = "#" class = "nav-link" > Active< / a >
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:08:18 +02:00
< a class = "nav-link dropdown-toggle" data-toggle = "dropdown" href = "#" > Dropdown< / a >
2014-03-17 03:03:53 +01:00
< ul class = "dropdown-menu" role = "menu" >
< li > < a href = "#" > Action< / a > < / li >
< li > < a href = "#" > Another action< / a > < / li >
< li > < a href = "#" > Something else here< / a > < / li >
< li class = "divider" > < / li >
< li > < a href = "#" > Separated link< / a > < / li >
< / ul >
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:08:18 +02:00
< a href = "#" class = "nav-link" > Another link< / a >
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item disabled" >
2014-07-10 01:08:18 +02:00
< a href = "#" class = "nav-link" > Disabled< / a >
< / li >
2014-03-17 03:03:53 +01:00
< / ul >
< / div >
{% highlight html %}
2014-05-10 00:05:20 +02:00
< ul class = "nav nav-tabs" role = "tablist" >
2014-03-17 03:03:53 +01:00
...
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:08:18 +02:00
< a class = "nav-link dropdown-toggle" data-toggle = "dropdown" href = "#" >
2014-07-08 23:23:34 +02:00
Dropdown
2014-03-17 03:03:53 +01:00
< / a >
2014-05-29 02:05:54 +02:00
< ul class = "dropdown-menu" role = "menu" >
2014-03-17 03:03:53 +01:00
...
< / ul >
< / li >
...
< / ul >
{% endhighlight %}
< h3 > Pills with dropdowns< / h3 >
< div class = "bs-example" >
2014-07-08 04:22:00 +02:00
< ul class = "nav nav-pills" role = "tablist" >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item active" >
2014-07-10 01:08:18 +02:00
< a href = "#" class = "nav-link" > Active< / a >
< / li >
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:08:18 +02:00
< a class = "nav-link dropdown-toggle" data-toggle = "dropdown" href = "#" > Dropdown< / a >
2014-03-17 03:03:53 +01:00
< ul class = "dropdown-menu" role = "menu" >
< li > < a href = "#" > Action< / a > < / li >
< li > < a href = "#" > Another action< / a > < / li >
< li > < a href = "#" > Something else here< / a > < / li >
< li class = "divider" > < / li >
< li > < a href = "#" > Separated link< / a > < / li >
< / ul >
< / li >
2014-07-10 01:08:18 +02:00
< li class = "nav-item" >
< a href = "#" class = "nav-link" > Another link< / a >
< / li >
< li class = "nav-item disabled" >
< a href = "#" class = "nav-link" > Disabled< / a >
< / li >
2014-03-17 03:03:53 +01:00
< / ul >
2014-07-10 01:08:18 +02:00
< / div >
2014-03-17 03:03:53 +01:00
{% highlight html %}
2014-07-08 04:22:00 +02:00
< ul class = "nav nav-pills" role = "tablist" >
2014-03-17 03:03:53 +01:00
...
2014-07-10 07:19:23 +02:00
< li role = "presentation" class = "nav-item" >
2014-07-10 01:08:18 +02:00
< a class = "nav-link dropdown-toggle" data-toggle = "dropdown" href = "#" >
2014-07-08 23:23:34 +02:00
Dropdown
2014-03-17 03:03:53 +01:00
< / a >
2014-05-29 02:05:54 +02:00
< ul class = "dropdown-menu" role = "menu" >
2014-03-17 03:03:53 +01:00
...
< / ul >
< / li >
...
< / ul >
{% endhighlight %}
< / div >