I'm struggling to create a collapsible navigation bar for my website that works well on mobile devices.
Here's the code for my navigation bar:
<div style="padding-bottom: 50px;">
<header id="main-header">
<div class="container">
<a href="@Url.Action("Index", "Home")">
<img src="~/ToDo_logo1.png" id="logo" alt="logo" style="width:140px; height:50px;" />
</a>
<nav class="main-nav" role="navigation">
<ul>
@if (User.IsInRole("Admin"))
{
<li class="@(ViewBag.Linktext == "Venues" ? "current" : "")">@Html.ActionLink("Venues", "Index", "Venues")</li>
<li class="@(ViewBag.Linktext == "Events" ? "current" : "")">@Html.ActionLink("Events", "Index", "Events")</li>
<li class="@(ViewBag.Linktext == "Bands" ? "current" : "")">@Html.ActionLink("Bands", "Index", "Bands")</li>
<li class="@(ViewBag.Linktext == "Admin" ? "current" : "")">@Html.ActionLink("Admin", "Admin", "Home")</li>
@Html.Partial("_LoginPartial")
}
else
{
<li class="@(ViewBag.Linktext == "Venues" ? "current" : "")">@Html.ActionLink("Venues", "Index", "Venues")</li>
<li class="@(ViewBag.Linktext == "Events" ? "current" : "")">@Html.ActionLink("Events", "Index", "Events")</li>
<li class="@(ViewBag.Linktext == "Bands" ? "current" : "")">@Html.ActionLink("Bands", "Index", "Bands")</li>
<li>@Html.Partial("_LoginPartial")</li>
}
</ul>
</nav>
</div>
</header>
</div>
Although the navigation links disappear with this code, I can't seem to figure out how to make the collapsible navigation bar icon show up with the links in it.
If you require any more code, feel free to ask