Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap icon-bar not showing

the icon-bar in the navbar menu of Bootstrap not showing when resizing the browser:

http://jsbin.com/ixAqinA/1/

   <section class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a href="/">
        brand
      </a>
    </div>
    </section>

you can see the JSBin example live: http://jsbin.com/ixAqinA/1/

like image 857
elkebirmed Avatar asked Oct 06 '13 08:10

elkebirmed


3 Answers

You have to wrap it inside

<nav class="navbar navbar-default" role="navigation"></nav>
  • Your code corrected: http://jsbin.com/ixAqinA/5/
  • Example from Bootstrap documentation
like image 164
Sanjo Avatar answered Nov 16 '22 22:11

Sanjo


I had a similar issue, but this solution did not work for me because of changes in Bootstrap.

For Bootstrap 3.1.1, I needed the following style to show the icon bars on a custom colored navbar that is fixed to the top (so .navbar-default doesn't work)

.navbar-toggle .icon-bar{ background-color: #fff;}

Just change #fff for the color you would like to show.

like image 34
Scone Avatar answered Nov 16 '22 21:11

Scone


Bootstrap 4 doesn't use .icon-bar any more. There it has to be done like:

<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
</button>

For more details you should look here or in the documentation of Bootstrap 4

like image 2
theoretisch Avatar answered Nov 16 '22 20:11

theoretisch