I'm having trouble positioning the Login/Register
link to the right of my navbar. I've checked other solutions on this platform, but they either involve dropdown menus or don't work for me.
Here's my Navbar code:
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7c1e1313080f080e1d0c3c49524f524c511d100c14d">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="761419190205020417063643584558465b171a061e1747">[email protected]</a>/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
<nav class="navbar navbar-dark navbar-expand-md bg-dark justify-content-md-center justify-content-start">
<button class="navbar-toggler ml-1" type="button" data-toggle="collapse" data-target="#collapsingNavbar2">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse justify-content-between align-items-center w-100" id="collapsingNavbar2">
<ul class="navbar-nav mx-auto text-md-center text-left">
...
<li class="nav-item">
<a class="nav-link" href="#">Login/Register</a>
</li>
</ul>
</div>
</nav>
I attempted to use
<ul class="navbar-nav ml-auto">
to surround the Login/Register Nav item, but it didn't work. I'm working with Bootstrap 5.3.
Here's the updated Navbar code with the ul
class including ml-auto
, but still facing issues. Perhaps it's related to how I'm including Bootstrap?
Code:
<!DOCTYPE html>
<html lang="en">
<head>
...
</body>
<style>
h1{
font-family: 'Roboto', sans-serif;
}
.nav-link {
font-size: 25px !important;
margin-right: 15px !important;
}
.dropdown-item {
font-size: 20px !important;
}
</style>
</html>