0

I am trying to use the Bootstrap class="icon-bar" but its not showing up on the screen. The elements are present in the screen but default height and width is showing up 0.

I have been through multiple questions on Stack Overflow and different sites but no help.

Following is the code:

</head>
<body>
    <nav class="navbar navbar-default navbar-fixed-top bg-light">
        <div class="containter">
            <button type="button" class ="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                   <span class="sr-only">Toggle navigation</span>
                   <span class="icon-bar"></span>
                   <span class="icon-bar"></span>
                   <span class="icon-bar"></span>
            </button>
        </div>
   </nav>
</body>

Image: span.icon-var invisible

Links that I have followed:

Bootstrap icon-bar span not visible

Bootstrap icon-bar not showing

Bootstap:span class icon bar not working

2
  • There is no icon-bar class defined in bootstrap 4. Please refer to current versions documentation. getbootstrap.com/docs/4.4/components/navbar
    – Akhi Akl
    Dec 6, 2019 at 9:05
  • Thank you so much. I am really very stupid. I was thinking that all the Bootstrap 3 attributes would be consumable in Bootstrap 4 as well. Thanks a lot again sir.
    – Anand
    Dec 6, 2019 at 9:09

1 Answer 1

0

As answered in the comments by @Akhi, there is no span.icon-bar in Bootstrap 4.

Instead we need to use the class: <span class="navbar-toggler-icon"></span>

Doing so has resolved my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.