I am struggling to create a collapsible navbar
. Even though everything seems to be working, the nav
items are not stacking vertically as they should be. Instead, they are appearing horizontally next to each other.
Here is the code snippet:
<nav class="navbar navbar-light bg-faded" role="navigation">
<button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#collapsing-navbar">
☰
</button>
<div class="collapse navbar-toggleable-xs" id="collapsing-navbar">
<a class="navbar-brand" href="/">Logo</a>
<ul class="nav navbar-nav">
<li class="nav-item">
<a href="/messages" class="nav-link">Messages</a>
</li>
<li class="nav-item">
<a href="/logout" class="nav-link">Logout</a>
</li>
</ul>
</div>
</nav>
Here is the screenshot for reference: