Currently, I am in the process of creating a hamburger menu with Bootstrap and I have managed to customize the open and close buttons according to my preferences. However, I am facing an issue where the hamburger icon is not displaying properly.
See the code snippet below:
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a6c4c9c9d2d5d2d4c7d6e69388968897">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.bundle.min.js"></script>
<nav class="navbar navbar-light bg-light">
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="close" style="margin-left:20px><img src="images/mobile-menu-close.png" width="33"></span>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<ul class="navbar-nav" style>
<li class="nav-item"><a href="" class="nav-link">Link</a></li>
<li class="nav-item"><a href="" class="nav-link">Link</a></li>
<li class="nav-item"><a href="" class="nav-link">Link</a></li>
</ul>
</div>
</nav>
the css:
<style type="text/css">
.navbar-toggler>.close {
display:inline;
}
.navbar-toggler.collapsed>.close, .navbar-toggler:not(.collapsed)>.navbar-toggler-icon {
display:none;
}
.navbar-light .navbar-toggler-icon{
background-image: url(images/mobile-menu-open.png)!important;
background-size: 33px 33px;
background-repeat:no-repeat;
margin-left: 20px;
}
.navbar-toggler {
border: none;
background-color: transparent;
}
.navbar-toggler:focus,
.navbar-toggler:active,
.navbar-toggler-icon:focus {
outline: none;
box-shadow: none;
}
.navbar{
width: 200px;
background-color: transparent!important;
}
.navbar-collapse{
background-color: gray;
}
</style>
Below are the corresponding images: https://i.sstatic.net/J2stv.png https://i.sstatic.net/iWgrk.png Any thoughts on how to resolve this issue?
Furthermore, I have included an image showcasing the malfunctioning hamburger menu: https://i.sstatic.net/SnUKl.png