I previously attempted to implement the solution provided atHow do I change Bootstrap 3 column order on mobile layout?, however, it only works with bootstrap3. I am looking to rearrange the order of the navbar when it is collapsed on a small screen.
Here is my current navbar code:
<a class="navbar-brand" href="#">Website Name</a>
<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="#">1</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="#">2</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="#">3</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="#">4</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="#">5</a>
</li>
<li class="nav-item active ">
<a class="nav-link" href="#">6 <span class="sr-only">(current)</span></a>
</li>
</div>
</nav>
When collapsed, the links are displayed as:
|1|
|2|
|3|
|4|
|5|
|6|
My goal is to display them in the following order:
|6|
|5|
|4|
|3|
|2|
|1|
Any suggestions on how to achieve this using bootstrap 4?