垂直居中導航項目,因此,我已經把我的navbar
到80px
定製的高度,但現在讓我的導航項目不垂直居中。我一直在尋找一個答案,將它們垂直居中放置一段時間,所以我想我會給StackOverflow一個鏡頭。在引導3
截圖:http://screencast.com/t/zfUuX9SSQK
HTML:
<div class="container-fluid isModified">
<div class="row">
<nav class="navbar isModified" role="navigation">
<div class="col-lg-8 col-lg-offset-2">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav-collapse">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar isModified"></span>
<span class="icon-bar isModified"></span>
<span class="icon-bar isModified"></span>
</button>
<a href="index.php" class="navbar-brand">Tickets</a>
</div>
<div class="collapse navbar-collapse" id="nav-collapse">
<ul class="nav navbar-nav isModified">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
</ul>
</div>
</div> <!-- end col-lg-12 -->
</nav>
</div> <!-- end row -->
</div> <!-- end container -->
CSS:
.navbar.isModified {
height: 80px;
border-radius: 0;
background-color: #cccccc;
}
.icon-bar.isModified {
background-color: #fff;
}
你想要的鏈接作爲'80px'高度呢?或者只是保持當前的高度,但垂直居中對齊? –
保持導航欄(80px)的當前高度,但有聯繫的裏面垂直居中在那裏他們甚至從頂部和底部的空間。 –