I'm using Material Design Bootstrap on my responsive website.
On large screen in my navbar at the top I have:
- My Brand link aligned left
- Two page links
- Profile dropdown aligned right
Large screen look:
Intention is that when I resize the screen to small device, I will have:
- Toggler to expand the menu aligned left
- My Brand link aligned in the middle
- Profile dropdown aligned right
And when the toggler is clicked then the menu with two page links will expand, but the top navbar stays the same (toggler, My Brand, Profile).
Desired look on small screen after expansion:
What is happening is that when the toggler is clicked then My Brand link gets aligned right in the navbar and the Profile dropdown gets shown at the end of expanded menu.
Current behavior (wrong):
Here is live code in mdbootstrap.com snippet editor: https://mdbootstrap.com/snippets/jquery/temp/966115
<nav class="navbar navbar-expand-sm navbar-dark indigo">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-top">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand font-weight-bolder" href="#">My Brand</a>
<div class="collapse navbar-collapse" id="navbar-top">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
<div>
<ul class="navbar-nav mr-1 mt-lg-1">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle waves-effect waves-light" id="profile-dropdown"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-user"></i>
<span>Profile</span>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-info" aria-labelledby="profile-dropdown">
<a class="dropdown-item waves-effect waves-light text-nowrap" href="/account">
<i class="fas fa-user-cog navbar-profile-icon"></i>
<span>My account</span>
</a>
<a class="dropdown-item waves-effect waves-light text-nowrap" href="/logout">
<i class="fas fa-sign-out-alt navbar-profile-icon"></i>
<span>Logout</span>
</a>
</div>
</li>
</ul>
</div>
</nav>
Help is appreciated, thanks!