Snippet of Code (With Bootstrap 4.5):
$(".self-first-ul").append('<li class="nav-item">A lengthy sentence that is too long for small screens.</li>');
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<nav class="navbar sticky-top navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="http://localhost/project/">Name</a>
<ul class="navbar-nav self-first-ul">
</ul>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href=""><img src="" alt="" title="" width="30" height="30" loading="lazy" />
<span>1</span>
</a>
</li>
</ul>
</div>
</nav>
Display on Large Screen:-
Display on Small Screen:-
Preferred Design for Small Screens:-
I attempted to add an additional navbar below the first one, however, it did not align well on large screens and caused overlap on small screens.