I'm struggling with a simple html page that has a fixed navbar at the top. Everything looks great when viewed in full-screen mode, with centered links. However, when the page size is reduced, it collapses to a toggle button on the left side. What I really want is for this toggle button and the dropdown links to align neatly on the right side of the page. I'm currently using a local copy of Bootstrap 5. Is there a way to accomplish this while still having the link items appear centered in full screen mode?
So far, I've tried options like navbar-toggler-right, but they haven't been helpful.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap 5 - Test Navbar Page</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Testing Navbar">
<meta name="keywords" content="bootstrap5,html">
<meta name="author" content="Bootstrap 5">
<!-- Bootstrap 5 -->
<link rel="stylesheet" href="css/bootstrap.min.css"></link>
</head>
<body>
<nav class="navbar navbar-expand-sm bg-light navbar-light fixed-top">
<!-- Toggler/collapsibe Button -->
<button class="navbar-toggler ms-2" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle Navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-center" id="navbarCollapse">
<ul class="navbar-nav ms-2">
<li class="nav-item">
<a class="nav-link" href="#">Resources</a>
</li>
<li>
<a class="nav-link" href="#">Contact</a>
</li>
<li>
<a class="nav-link" href="#">Login</a>
</li>
<li>
<form action="#">
<input type="submit" class="btn btn-warning" value="Register">
</form>
</li>
</ul>
</div>
</nav>
<!-- Bootstrap 5 -->
<script src="js/bootstrap.bundle.min.js"></script>
</body>
</html>
Current Full Page View
https://i.sstatic.net/SMZXe.png
Current Collapsed View