Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the purpose of separate navbar and navbar-inner classes?

In Twitter bootstrap's starter-template.html, the navbar is written as

<div class="navbar">
  <div class="navbar-inner">
    <div class="container">
    ...
    </div>
  </div>
</div>

However, if I change the markup to

<div class="navbar navbar-inner">
  <div class="container">
  ...
  </div>
</div>

everything seems to work fine and there's no discernible visual differences as far as I can tell. What's the reason to have separate navbar and navbar-inner classes associated with two divs? Why not just have a navbar class that combines styles of both?

like image 317
Tony Avatar asked Jul 02 '13 18:07

Tony


People also ask

What is the difference between navbar and navbar-inner?

The .navbar class sets the position (and has a default display inline) while the navbar-inner class wraps the content of this container (display table). Your .navbar can contain more as one blocks like navbar-inner.

Which class is used to create a navigation bar?

The .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.

What is the use of navbar in HTML?

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 the difference between navbar-brand and toggle navigation?

1 Answer 1. 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. Refer to the image below to better understand. Now coming to the second question. The class applied to Toggle Navigation is sr-only that stands for screen reader only.


Video Answer


1 Answers

It makes the stucture of your html document more clear and readable. The .navbar class sets the position (and has a default display inline) while the navbar-inner class wraps the content of this container (display table). Your .navbar can contain more as one blocks like navbar-inner.

In your hierarchical DOM-structure .navbar has the same level as the .container(fluid) divs:

enter image description here

like image 162
Bass Jobsen Avatar answered Nov 21 '22 14:11

Bass Jobsen