I am having trouble with my Bootstrap 3 navbar collapsing properly. Any advice would be appreciated.
I have already searched extensively for a solution, but haven't found the right one yet.
The navbar I created is responsive and based on the Bootstrap demo code. It contains a 40x40 image and a globe icon that open dropdown menus, which I have positioned to the right and excluded from the collapse.
However, when the navbar collapses, the 40x40 image and globe icon are displayed on a new line, which is not the desired outcome.
I would like the 40x40 image and globe icon to be on the same line as my brand image, collapse button, etc.; aligned to the right and not included in the collapse.
Below is the code snippet for reference:
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-hd-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.php"><img class="navbar-brand img-responsive" src="http://placehold.it/138x38" alt="Logo"></a>
</div>
<div class="navbar-right">
<ul class="nav" style="float: right; display: inline-block !important">
<li class="dropdown pull-right">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="http://placehold.it/40x40" alt="Profile Image" style="display: inline-block !important"/><b class="caret grey"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Hello</li>
<li class="divider"></li>
<li><a href="">Thing 1</a></li>
<li class="divider"></li>
<li><a href="">Thing 2</a></li>
</ul>
</li>
</ul>
<ul class="nav" style="float: right; display: inline-block !important">
<li class="dropdown pull-right">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-globe grey"></span><b class="caret grey"></b></a>
<ul class="dropdown-menu">
<li style="padding: 10px"><p>News</p></li>
</ul>
</li>
</ul>
<div class="collapse navbar-collapse navbar-hd-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="">Product</a></li>
<li><a href="">Other Product</a></li>
<li><a href="">Third Product</a></li>
</ul>
</div>
</nav>
For further reference, please see the JS Fiddle link: http://jsfiddle.net/CaraGee/q8br8/