I have been trying to design a header using Bootstrap 5. I want the navigation links within the header to float to the right side. However, despite applying the justify-content-end class as seen on the Bootstrap website, the items remain aligned to the left. I even attempted adding float: right to the nav element, but it did not produce the desired effect.
Below is my HTML code:
<nav class="navbar navbar-dark bg-dark">
<!-- Navbar content -->
<ul class="nav justify-content-end" id="myNavbar">
<li class="nav-item">
<a class="nav-link" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
</ul>
This is my CSS code:
ul {
float: right !important:
}
I am seeking assistance in resolving this issue. Can anyone please guide me on how to fix this?