I have a bootstrap website where the Hamburger
is added when the screen is less than 992px. The HamBurger code is like so
<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>
Is there any possibility to change the color of the HamBurger button?
Use a font-awesome icon as the default icon of your navbar.
Or try this on old font-awesome versions:
Check the best solution for custom hamburger nav.
demo image
EDIT : my bad! With my answer, the icon won't behave as a toggler Actually, it will be shown even when not collapsed... Still searching...
This would work :
The trick proposed by my answer is to replace the
navbar-toggler
with a classical button classbtn
and then, as answered earlier, use an icon font.Note, that if you keep
<button class="navbar-toggler">
, the button will have a "strange" shape.As stated in this post on github, bootstrap uses some "css trickery", so users don't have to rely on fonts.
So, just don't use the
"navbar-toggler"
class on your button if you want to use an icon font.Cheers.
You can create the toggler button with css only in a very easy way, there is no need to use any fonts in SVG or ... foramt.
Your Button:
Your Button Style:
}
Your horizontal line Style:
}
Demo
just insert class
navbar-dark
ornavbar-light
in the nav element:As alternative you always can try a simpler workaround, using another icon, for example:
ref: https://www.w3schools.com/icons/fontawesome_icons_webapp.asp
ref: https://www.w3schools.com/icons/bootstrap_icons_glyphicons.asp
So you gain total control over their color and size:
(the button's style applied is just for a quick test):