希望 Bootstrap导航栏中的徽标和链接垂直居中对齐。
快到了。以下代码导致徽标与导航栏底部对齐,并且链接垂直居中对齐。我认为这与 LESS 和品牌有关,clearfix 类当然我在编译的 css 中看不到。我已经搜索过,许多答案似乎很接近,但还没有真正的答案。
<div class="navbar navbar-fixed-top">
<div class="navbar-inner clearfix">
<a class="brand" href="#"><img class="logo" src="img/mylogo.png"></a>
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="nav-collapse collapse">
<ul class="nav pull-right">
<li>
<a class="nav-text" href="#about">About</a>
</li>
<li>
<a class="nav-text" href="#pricing">Pricing</a>
</li>
<li>
<a class="nav-text" href="/blog">Blog</a>
</li>
<li>
<a class="nav-text" href="https://mysite.com">Support</a>
</li>
<li>
<a class="nav-text" href="/settings">Settings</a>
</li>
<li>
<a class="nav-text" data-toggle="modal" href="#myModal">
</i>Login</a>
</li>
</ul>
</div>
</div>
</div>
</div>
CSS是:
root {
display: block;
}
/* add style here */
body {
padding-left: 0;
padding-right: 0;
}
.navbar {
height: 60px;
opacity:0.8;
}
.navbar .navbar-inner {
background: #ffffff;
border: none;
-moz-box-shadow: 0px 3px 2px 0px #333333, 0px 1px 10px 0px rgba(0, 0, 0, 0.0980392);
-webkit-box-shadow: 0px 3px 2px 0px #333333, 0px 1px 10px 0px rgba(0, 0, 0, 0.0980392);
-o-box-shadow: 0px 3px 2px 0px #333333, 0px 1px 10px 0px rgba(0, 0, 0, 0.0980392);
box-shadow: 0px 3px 2px 0px #333333, 0px 1px 10px 0px rgba(0, 0, 0, 0.0980392);
height: 60px;
padding-left: 20px;
padding-right: 20px;
padding-top:10px;
}
.navbar .navbar-inner .responsive-container {
}
.nav-text {
font-family:"open sans";
font-size: 16px;
font-weight: bold;
color: #000000;
}