Navbars overview

Navbar is a navigation component, usually displayed on top of the page and includes brand logo, navigation and other components. By default, navbar has top static position. Navbar placement can be top and bottom, types can be static and fixed. Navbar available in 4 different sizes - large, default, small and mini. All navbar components automatically adjust their height to match chosen navbar height.

Since navbars are available in 4 different sizes, it's required to specify proper class in <body> tag to set correct padding. If single navbar is sticked to the bottom of the page, correct body classes will be .navbar-bottom for default height and .navbar-bottom-* for given size - large (*-lg), small (*-sm) and mini (*-xs).

Table below describes all navbar types and combinations available:

Option Description
Type
Single navbar Single navbar. Collapsible navbar, always displayed full width without spacings (except navbar component) and on top by default. Supports different navbar components and usually appears as a main navbar with branding info, user info and navigation.
Multiple navbars Multiple navbars have additional display options. They can be placed one after another, mixed with page header content and main content. Second sidebar is usually used as a separate component with main navigation (in horizontal navigation layout) and alternative content.
Navbar component Displayed as a stand-alone component: includes spacings, borders and rounded corners. Can be placed anywhere - content area, footer, header or used as a main navbar. Supports all available navbar components.
Positioning
Top single Single top navbar, usually a main navigation toolbar.
Top multiple Double top navbar. Can be both static or fixed, check navbar related pages.
Bottom single Single bottom navbar, usually a main navigation toolbar.
Bottom multiple Double bottom navbar. Can be both static or fixed, check navbar related pages.
Variations
Static Default option. Means navbar is scrolled out along with content.
Fixed Always sticket to the page top and always visible. Becomes static on mobiles.
Hideable Hide navbar on scroll down and display on scroll up. Animated by default and supports both top and bottom positions.
Styling
Default Light background with adapted components: navigation, links etc. Requires .navbar-default class added to the <navbar> container.
Inverse Dark background with adapted components: navigation, links etc. Requires .navbar-inverse class added to the <navbar> container.
Custom color Custom background color. Requires .navbar-inverse class and .bg-* color class added to the <navbar> container.
Navbar markup

Navbar markup is identical in all layout versions. It has one difference from default Bootstrap navbar component markup - <div class="container" /> has been removed since boxed layout is an extra option and replaced with <div class="navbar-boxed" /> container. All other options - default and custom - are supported in all variations and versions. Below you'll find markup examples of differetn variations of navbar component.

Static navbar

Static navbar is collapsible dy default, on mobiles and tablets its content is collapsed and available on button click. All default Bootstrap animations are removed for better performance:

<!-- Static navbar -->
<body>

	<!-- Main navbar -->
	<div class="navbar navbar-inverse">

		<!-- Navbar header -->
		<div class="navbar-header">
			<a class="navbar-brand" href="index.html">
				<img src="assets/images/logo_light.png" alt="">
			</a>

			<!-- Collapse button -->
			<ul class="nav navbar-nav pull-right visible-xs-block">
				<li>
					<a data-toggle="collapse" data-target="#navbar-mobile">
						<i class="icon-tree5"></i>
					</a>
				</li>
			</ul>
			<!-- /collapse button -->

		</div>
		<!-- /navbar header -->


		<!-- Navbar content -->
		<div class="navbar-collapse collapse" id="navbar-mobile">
			...
		</div>
		<!-- /navbar content -->

	</div>
	<!-- /main navbar -->

	...

</body>
<!-- /static navbar -->
Top fixed navbar

Top fixed navbar markup is similar to static, the only difference is it requires .navbar-fixed-top class added to the <navbar> container and proper body class to add top padding:

<!-- Top fixed navbar -->
<body class="navbar-top">

	<!-- Main navbar -->
	<div class="navbar navbar-inverse navbar-fixed-top">

		<!-- Navbar header -->
		<div class="navbar-header">
			<a class="navbar-brand" href="index.html">
				<img src="assets/images/logo_light.png" alt="">
			</a>

			<!-- Collapse button -->
			<ul class="nav navbar-nav pull-right visible-xs-block">
				<li>
					<a data-toggle="collapse" data-target="#navbar-mobile">
						<i class="icon-tree5"></i>
					</a>
				</li>
			</ul>
			<!-- /collapse button -->

		</div>
		<!-- /navbar header -->


		<!-- Navbar content -->
		<div class="navbar-collapse collapse" id="navbar-mobile">
			...
		</div>
		<!-- /navbar content -->

	</div>
	<!-- /main navbar -->

	...

</body>
<!-- /top fixed navbar -->
Bottom fixed navbar

Bottom fixed navbar markup is similar to static and top fixed, the only difference is it requires .navbar-fixed-bottom class added to the <navbar> container and proper body class to add bottom padding:

<!-- Bottom fixed navbar -->
<body class="navbar-bottom">

	<!-- Main navbar -->
	<div class="navbar navbar-inverse navbar-fixed-bottom">

		<!-- Navbar header -->
		<div class="navbar-header">
			<a class="navbar-brand" href="index.html">
				<img src="assets/images/logo_light.png" alt="">
			</a>

			<!-- Collapse button -->
			<ul class="nav navbar-nav pull-right visible-xs-block">
				<li>
					<a data-toggle="collapse" data-target="#navbar-mobile">
						<i class="icon-tree5"></i>
					</a>
				</li>
			</ul>
			<!-- /collapse button -->

		</div>
		<!-- /navbar header -->


		<!-- Navbar content -->
		<div class="navbar-collapse collapse" id="navbar-mobile">
			...
		</div>
		<!-- /navbar content -->

	</div>
	<!-- /main navbar -->

	...

</body>
<!-- /bottom fixed navbar -->
Collapsed navbar

There is one additional option, when navbar doesn't have a logo and used as a toolbar. In this case the whole navbar becomes a link on mobiles and tables, all navbar content opens on click. Supports all options stated above:

<!-- Collapsed navbar -->
<body>
	
	<!-- Navbar -->
	<div class="navbar navbar-default">

		<!-- Collapse button -->
		<ul class="nav navbar-nav no-border visible-xs-block">
			<li>
				<a class="text-center collapsed" data-toggle="collapse" data-target="#navbar-second-toggle">
					<i class="icon-menu7"></i>
				</a>
			</li>
		</ul>
		<!-- /collapse button -->


		<!-- Navbar content -->
		<div class="navbar-collapse collapse" id="navbar-second-toggle">
			...
		</div>
		<!-- /navbar content -->

	</div>
	<!-- /navbar -->

	...

</body>
<!-- /collapsed navbar -->
Navbar is a complex and very flexible component, which allows you to control appearance of different types of content, components placement, sizes, colors etc. All this functionality is available by setting proper classes to the navbar components and navbar itself. Table below demonstrates all available classes that can be used with the navbar:
Class Description
.navbar Default navbar class, must be used with any navbar type and color. Responsible for basic navbar and navbar components styling as a parent container.
.navbar-fixed-top Makes navbar sticked to the top of the page. Requires proper class for <body> tag, see the table below.
.navbar-fixed-bottom Makes navbar sticked to the bottom of the page. Requires proper class for <body> tag, see the table below.
.navbar-static-top Full-width navbar that scrolls away with the page. Unlike the .navbar-fixed-* classes, no need to add any extra class on the body for padding correction.
.navbar-default
.navbar-inverse
Default color options for navbar provided by Bootstrap styles: default - white navbar, inverse - dark grey navbar.
.navbar-default-secondary If you have 2 light navbars, use this class to darken one of them. Based on default navbar background color.
.navbar-inverse.bg-* Optional background colors for navbar. Just add one of available color classes to apply custom color scheme.
.navbar-component Display navbar as a stand alone component, with border and rounded corners.
Body classes
Bottom navbar is available only as a fixed component, always sticked to the bottom of the page. All dropdown menus are automatically changed to dropups in this type of navbar. The fixed navbar will overlay your other content, unless you add necessary to the top of the <body>. Depending on the fixed navbar position and size, add one of the classes specified in the following table. By default, the navbar is 47px high.
Class Description
.navbar-top
.navbar-bottom
This class adds necessary top or bottom padding to the <body> tag. Works only with default navbar height. If another height is specified, apply another class, see the line below.
.navbar-top-*
.navbar-bottom-*
Controls padding for different navbar heights, for both positions. Available classes: mini (*-xs), small (*-sm) and large (*-lg). Default navbar requires .navbar-top(bottom)-fixed class.
.navbar-top-*-*
.navbar-bottom-*-*
This type of classes is used only with multiple navbars. This is the only class, where *-md suffix is available. For example class .navbar-top-md-xs means main navbar has default height (.*-md-*), secondary navbar - mini height (.*-xs). It calculates both navbars height and adds top or bottom padding with the same value.