I'm trying to change the color of the navbar using a custom color with css but so far no luck, I even went through various searches but those do not work as well. I've used navbar, navbar-custom, and other names to try and modify the color in css but none work.
HTML:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Blog</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.2/css/all.css" integrity="sha384-vSIIfh2YWi9wW0r9iZe7RJPrKwp6bG+s9QZMoITbCckVJqGCCRhc+ccxNcdpHuYu" crossorigin="anonymous">
</head>
<body>
<section id="title">
<div class="container-fluid">
<!-- Nav Bar -->
<nav class="navbar navbar-custom navbar-expand-lg">
<a class="navbar-brand" href="#">Blog</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo01">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#footer">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#pricing">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#cta">Contact</a>
</li>
</ul>
</div>
</nav>
</div>
</section>
</body>
</html>
CSS:
.navbar-custom{
background-color: red;
}
question from:
https://stackoverflow.com/questions/66066472/unable-to-change-the-background-color-of-navbar-to-a-custom-using-css-in-bootstr 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…