Reputation: 277
I have been wanting to exclude a certain item on the navbar from the collapse box when the screen becomes small.
This is the HTML code I have so far:
<div class="container">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navBar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="."><img class="ico_img" src="assets/ico_img.png" /></a>
</div>
<div class="collapse navbar-collapse" id="navBar">
<ul class="nav navbar-nav">
<li class="active"><a>Home</a></li>
<li><a href="page1.php">Page 1</a></li>
<li><a href="page2.php">Page 2</a></li>
<li><a href="page3.php">Page 3</a></li>
</ul>
<ul class="nav navbar-nav navbar-right hidden-xs">
<li><a class="welcome"></a></li>
</ul>
</div>
</div>
</nav>
</div>
I would like to exclude the welcome part. One solution I have found thus far is by adding the 'hidden-xs' class attribute to hide the welcome message when the collapse toggle appears, but is there a cleaner way to do this?
Upvotes: 0
Views: 1046
Reputation: 472
You can do it with a bunch of .visibble-*-*. It's cleaner with an .hidden-xs.
Upvotes: 2