我無法弄清楚如何將我們的IMG集中在導航欄上。道歉這是一個基本的問題。導航欄上的中心IMG
文本對齊不起作用,以下操作不起作用bc它使img走到導航欄列表的上方。任何人有最簡單的修復任何想法?非常感謝!
display: block;
margin-left: auto;
margin-right: auto }
.logo img {
width: 34%;
max-width: 150px;
max-height: 150px;
height: 35%;
}
.nav-item--left {
float: left;
margin-right: 20px;
margin-top: 35px;
}
@media (min-width: 768px) {
.nav-item--left {
margin-right: 25px;
}
}
.nav-item--right:last-child {
margin-right: 0;
}
.nav-item--right {
display: block;
}
.nav-item--right {
float: right;
margin-right: 20px;
margin-top: 35px;
}
@media (min-width: 768px) {
.nav-item--right {
margin-right: 25px;
}
}
.nav-item--right:last-child {
margin-right: 0;
}
.nav-item--right {
display: block;
}
<div id="narrow-display-test" style="display:none"></div>
<header class="header container container--fluid container--darkBackground js-header">
<div class="container">
<a href="/" class="logo">
<img src="http://cdn.sstatic.net/Sites/stackoverflow/img/[email protected]" alt="alt">
</a>
<ul class="nav">
<li class="nav-item">
<a class="nav-itemText nav-itemText--link">
<div class="header" ng-controller="LoginCtrl">
<div class="clearfix">
<div class="welcome pull-right" ng-show="userLoaded">
<a class="nav-itemText nav-itemText--link" href="">
<span ng-show="currentUser">Your Site</span>
</a>
</div>
</div>
</div>
</a>
</li>
<li class="nav-item">
<a class="nav-itemText nav-itemText--link">
<div class="header" ng-controller="LoginCtrl">
<div class="clearfix">
<div class="welcome pull-right" ng-show="userLoaded">
<a class="nav-itemText nav-itemText--link" href="/">
<span ng-show="currentUser">Your Site2 </span>
</a>
</div>
</div>
</div>
</a>
</li>
<li class="nav-item">
<a class="nav-itemText nav-itemText--link">
<div class="header" ng-controller="LoginCtrl">
<div class="clearfix">
<div class="welcome pull-right" ng-show="userLoaded">
<a class="nav-itemText nav-itemText--link" href="/">
<span ng-hide="currentUser">
Your Site 3
</span>
</a>
</div>
</div>
</div>
</a>
</li>
<li class="nav-item">
<a class="nav-itemText nav-itemText--link">
<div class="header" ng-controller="LoginCtrl">
<div class="clearfix">
<div class="welcome pull-right" ng-show="userLoaded">
<a class="nav-itemText nav-itemText--link" href="/">
<span ng-hide="currentUser">
Your Site 4
</span>
</a>
</div>
</div>
</div>
</a>
</li>
<li class="nav-item">
<a class="nav-itemText nav-itemText--link">
<div class="header" ng-controller="LoginCtrl">
<div class="clearfix">
<div class="welcome pull-right" ng-show="userLoaded">
<a class="nav-itemText nav-itemText--link">
<ng-include src="'/partials/login.html'"></ng-include>
</a>
</div>
</div>
</div>
</a>
</li>
</ul>
</div>
請正確格式化代碼,並添加到您的html也 – Pushpendra
哪裏是你的HTML? – hello
對不起,它已更新! @hello –