Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "navbar-header" class do in Bootstrap?

I have been using .navbar-header class of Bootstrap for my navigation bars for quite a while but never bothered to wonder why. I searched online as to why we use it but didn't find any explanation. Can someone explain what is it's purpose?

<nav class="navbar navbar-inverse ">   <div class="container-fluid">     <div class="navbar-header">       <a href="#" class="navbar-brand">         Website Name       </a>     </div>     </div> </nav> 
like image 778
Sift Avatar asked Jan 09 '16 02:01

Sift


People also ask

What is navbar class in Bootstrap?

Basic Navbar With Bootstrap, a navigation bar can extend or collapse, depending on the screen size. A standard navigation bar is created with the .navbar class, followed by a responsive collapsing class: .navbar-expand-xl|lg|md|sm (stacks the navbar vertically on extra large, large, medium or small screens).

What does navbar class do?

navbar class is used to create a navigation bar. The navbar can extend or collapse, depending on the device size ie, the navbar is used to create the responsive design by using . navbar-expand-xl|lg|md|sm class. So, It provides flexibility to the web page.

What is a header navigation bar?

Navigation Bars A navigation bar is a navigation header that is placed at the top of the page: WebSiteName. Home.

What is navbar-brand class?

navbar-brand class is applied to typical branding logo you see in the top navigation bar.It may just contain a typical image logo or text.


1 Answers

The navbar-header is mostly an architectural class for Bootstrap navbar. It allocates approximately 150px to the left of the navbar to wrap the navbar-brand and allow the brand name or logo to make use of the entire area on click or hover. But the most useful property of the navbar-header is its responsiveness to 100% width on and after 768px (tablet views). This allows the brand to be centered at the top of the viewport which it is a nicety to have to avoid your responsive menu overlapping your brand when it opens. EDIT --> The navbar-brand doesn't respond to 100% width.

But you are right, little it's said about this class in the web, because it doesn't per se execute a function. Most people just either leave it alone, replace it, or use it as a hook (parent) class to target the navbar-brand or any other element they wanted to include within.

like image 93
LOTUSMS Avatar answered Sep 24 '22 00:09

LOTUSMS