I need my Bootstrap Navbar elements to remain on a single line regardless of the screen width.
Although I have searched for a solution to this issue numerous times and tried different approaches, none have proven effective in my case.
Below is the code snippet I am currently using:
#head-navbar {
width: 100%;
white-space: nowrap;
display: inline-block;
overflow: hidden;
}
.nav>li {
display: inline-block;
white-space: nowrap;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<nav class="navbar navbar-inverse navbar-fixed-top navbar-collapse" id="head-navbar">
<ul class="nav navbar-nav">
<li><a class="#" href="#">Home</a>
</li>
<li><a href="#">Page 1</a>
</li>
<li><a href="#">Page 2</a>
</li>
</ul>
<ul class="nav navbar-nav pull-right">
<li><a href="#">DE</a>
</li>
<li><a href="#">IT</a>
</li>
</ul>
</nav>
The desired appearance of my Navbar on small screens should be like this:
https://i.sstatic.net/UiHsD.jpg
and not like this: