Navs
Documentation and examples for how to use Bootstrap’s included navigation components.
Base nav
Navigation available in Bootstrap share general markup and styles, from the base .nav class to the active and disabled states. Swap modifier classes to switch between each style.
The base .nav component is built with flexbox and provide a strong foundation for building all types of navigation components. It includes some style overrides (for working with lists), some link padding for larger hit areas, and basic disabled styling.
Classes are used throughout, so your markup can be super flexible. Use <ul>
s like above, <ol>
if the order of your items is important, or roll your own with a <nav>
element. Because the .nav
uses display: flex
, the nav links behave the same as nav items would, but without the extra markup.
Available styles
Change the horizontal alignment of your nav with flexbox utilities. By default, navs are left-aligned, but you can easily change them to center or right aligned.
Classes
Add .nav-horizontal-scroll
for some extra horizontal scrolling.
Fill and justify
Force your .nav
’s contents to extend the full available width
one of two modifier classes. To proportionately fill all available space with your
.nav-item
s, use .nav-fill
. Notice that all horizontal space is occupied,
but not every nav item has the same width.
Fill and justify
For equal-width elements, use .nav-justified
. All horizontal space will be occupied by
nav links, but unlike the .nav-fill
above, every nav item will be the same width.
Tabs
Takes the basic nav from above and adds the .nav-tabs
class to generate a tabbed
interface. Use them to create tabbable regions with Bootstrap's tab JavaScript plugin.
Pills
Take that same HTML, but use .nav-pills
instead:
Add your favourite class to the .nav-pills
or .nav-item
. Works perfectly
in combination with .nav-horizontal-scroll
for some extra horizontal scrolling.