Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

icon-bar class doesn't display the line in the Button

I have a navbar where there is a hamburger button which comes with the bootstrap which is

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

but when I remove thenavbar-toggler-icon class and apply icon-bar the button is disappers.But in the console it shows that there is a button a very tiny one. I have added the image for reference. enter image description here

EDIT: https://jsfiddle.net/8m1gyw7t/ this is working fine.

but in that code if I change from navbar-toggler-icon to icon-bar the button is small and tiny

like image 591
Rehan Avatar asked Dec 01 '25 07:12

Rehan


1 Answers

The problem is in bootstrap version, in your fiddle you are using bootstrap v4-alpha and the class icon-bar no more exist in v4.

Now if you want to use bootstrap v3 classes you need to replace your bootstrap v4 files with twitter-bootstrap-v3.

CDN LINK for bootstrap v3

and use following code

<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
  <span class="icon-bar"></span>
  <span class="icon-bar"></span>
  <span class="icon-bar"></span>
</button>
like image 55
Abhishek Pandey Avatar answered Dec 02 '25 22:12

Abhishek Pandey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!