我在导航栏中有一个徽标,旁边有文字。我想垂直居中文本,使其位于徽标的中间。当我尝试调整a.navbar-brand
时,一切都会移动。我是否需要使用单独的@Html.ActionLink
或span
标记包围div
代码,然后在css中引用该代码?
<div class="navbar-header">
<a class="navbar-brand">
<img alt="tribal_logo" src="~/Content/Images/tribal_logo2.gif" />
</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@Html.ActionLink("Fishing and Hunting License Program", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</div>
答案 0 :(得分:0)
尝试提供actionlink .btn-link类,然后调整导航栏的高度,如果有更高的高度。
答案 1 :(得分:0)
尝试以下内容
HTML
typeof(MyType).GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly)
CSS
<div class="navbar">
<div class="image col-md-2">asasda<img src=""></div>
<div class="desc col-md-10">
<p class="item-desc-text">Text.</p>
</div>
</div>