i am working on my MVConlineShop, and that's what i made so far:
Question : how to align these categories on the
nav bar
, can you please help me?
this is my CategoryLayout.cshtml
PartialView:
@model IEnumerable<MVCOnlineShop.Models.Category>
@{
ViewBag.Title = "Categories";
}
<ul>
@foreach (var Category in Model)
{
<li>
@Html.ActionLink(Category.CategoryName,
"Browse", new { Category = Category.CategoryName })
</li>
}
</ul>
and this is what i wrote in my _Layout.cshtml
:
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<div class="dropdown">
<button class="dropbtn">@Html.Partial("CategoryLayout")</button>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
</ul>
}
` to `none` in your CSS. Then, for your list items, add `display: inline-block`
– Kramb Jul 17 '17 at 13:32