答案 0 :(得分:1)
将下拉列表和切换器一起包裹在1 div ...
中https://www.codeply.com/go/H19BTH57m4
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="navbar">
<a class="navbar-brand" href="#">
<img src="//placehold.it/30" alt="" id="logo">
</a>
<div class="d-flex flex-row">
<div class="language-picker">
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle mr-2" href="index.html" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Language
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">English</a>
<a class="dropdown-item" href="#">French</a>
<!-- <div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">THE BEST SOLUTION</a> -->
</div>
</li>
</ul>
</div>
<button class="navbar-toggler hamburger hamburger--slider" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" id="toggleNav">
<span class="hamburger-box navbar-toggler-icon">
<span class="hamburger-inner"></span>
</span>
</button>
</div>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mx-auto">
<li class="nav-item">
<a class="nav-link" href="#"><span>CONTACT</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"><span>LOGIN</span></a>
</li>
<li class="nav-item">
<a class="nav-link chatIcon" href="#"><img src="//placehold.it/30" alt="a chat icon"></a>
</li>
</ul>
</div>
<!-- end collapse navbar-collapse -->
</nav>
另一种选择是在下拉列表中使用ml-auto
,然后将其从navbar-nav
:https://www.codeply.com/go/rtmowu5Bl9