我的頁面中有一個固定的頂部導航欄,導航欄設置爲固定高度的圖像,導航欄本身有一個高度,我想要做的是垂直對齊navbar品牌標誌在右側的大型響應式屏幕上列出,我該怎麼做? 這裏是我的代碼:具有標誌圖像和固定高度的響應式導航欄
.navbar{
height:150px;
}
.navbar-brand img{
height:95px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<html>
<body><!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">
<img src="http://placehold.it/150x50&text=Logo" alt="">
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<a href="#">About</a>
</li>
<li>
<a href="#">Services</a>
</li>
<li>
<a href="#">Contact</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
你想要的標誌下面去導航欄在移動的看法? –
@丹尼爾不,我希望他們彼此相鄰 – jessica
歡迎來到stackoverflow @ heba,如果有任何答案可以幫助你[把它投票](http://meta.stackexchange.com/questions/173399/how-to-upvote-on -stack-overflow),如果答案是你要找的標記爲 [Correct answe](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work)for未來的讀者。謝謝! –