将文本居中放在图像引导程序导航栏旁边

时间:2017-08-25 19:45:24

标签: html css twitter-bootstrap

我在导航栏中有一个徽标,旁边有文字。我想垂直居中文本,使其位于徽标的中间。当我尝试调整a.navbar-brand时,一切都会移动。我是否需要使用单独的@Html.ActionLinkspan标记包围div代码,然后在css中引用该代码?

enter image description here

        <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>

2 个答案:

答案 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>