我终于让我的Bootstrap导航栏使用了navbar-header中的搜索和购物车项目。
现在不幸的是,当我折叠菜单时,菜单项会移到顶部。发生这种情况,因为我正在使用向左拉和向右拉动我的导航栏标题。但是,如果我删除这些类,整个事情就会变得很糟糕。
我该如何解决这个问题?
请参阅Plunker:https://plnkr.co/edit/ttcYkU1ZgUjA1ekb8pbH?p=preview
<nav id="bootstrapOverride" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-flex">
<img class="hidden-xs" id="logoBig" src="content/img/logoGM.png" width="304" height="236" alt="Gute Mine logo">
<div class="navbar-header pull-left">
<a class="navbar-brand" href="#">
<img class="visible-xs" src="content/img/logoGM.png" width="210" height="60" alt="">
</a>
</div>
<div class="navbar-header pull-right">
<ul class="nav pull-left" id="menuIcons">
<li class="visible-xs pull-left"><a ui-sref=""><span class="glyphicon glyphicon-search"></span></a></li>
<li class="visible-xs pull-left"><a ui-sref=""><span class="glyphicon glyphicon-shopping-cart"></span></a></li>
</ul>
<button type="button" class="navbar-toggle" ng-click="isNavCollapsed = !isNavCollapsed">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" uib-collapse="isNavCollapsed">
<ul class="nav navbar-nav">
<li><a ui-sref="">Neu</a></li>
<li><a ui-sref="">Papier</a></li>
<li><a ui-sref="">Stifte</a></li>
<li><a ui-sref="">Technik</a></li>
<li><a ui-sref="">Zubehör</a></li>
<li><a ui-sref="">Geschenke</a></li>
<li class="hidden-xs"><a ui-sref=""><span class="glyphicon glyphicon-search"></span> Suche</a></li>
<li class="hidden-xs"><a ui-sref=""><span class="glyphicon glyphicon-shopping-cart"></span> Warenkorb</a></li>
</ul>
</div>
</div>
</nav>