Is there a way to align all the list content to the right in Bootstrap 5? I have tried using ml-auto
, float-end
, d-flex justify-content-end
but none of them seem to work. It used to work with ml-auto
in the previous version of Bootstrap, but I'm new to Bootstrap 5.
Here is my code:
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container-fluid">
<a class="navbar-brand" href="#">EXS</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Inicio</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Examenes</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contacto</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Iniciar sesión</a>
</li>
<li>
<a class=" btn btn-warning btn-sm my-1 text-light px-3" href="#">Regístrate</a>
</li>
</ul>
</div>
</div>
</nav>
</div>