I've been having trouble changing the color values in my navigation bar using CSS. I created classes for "active" and "inactive" to modify the colors, but it's not working as expected.
index.html
<!doctype html>
<html lang="en">
<head>
<title>Hello, world!</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="WDieter Reuther">
<meta name="description" content="Testing CSS">
<!-- Favicon -->
<link rel="shortcut icon" href="assets/images/favicon.png">
<!-- Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8eece1e1fafdfafceffecebba0bda0bd">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<!-- Customization -->
<link rel="stylesheet" type="text/css" href="assets/css/custom.css">
</head>
<body>
<header class="navbar-light navbar-sticky header-static">
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid" style="background-color: #27a800;">
<a class="navbar-brand" href="#">Navbar</a>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/">Home</a>
</li>
<li class="nav-item">
<a class="nav-link inactive" href="/page1.html">Page 1</a>
</li>
<li class="nav-item">
<a class="nav-link inactive" href="/page2.html">Page 2</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<h1>Hello, world!</h1>
</body>
</html>`
custom.css
@charset "UTF-8";
/*!
Custome Styling
*/
.inactive {color: #ffffff !important; }
.active {color: #333333 !important; }
Despite creating custom CSS styles, I'm unable to override the default bootstrap colors in my navigation menu. Additionally, I would like to know if it's possible to change the bootstrap colors directly via CSS, such as --bs-navbar-active-color.