skip to Main Content

I’m trying to change the color of the background and text for my navbar. When I use a class name that I chose or one from Bootstrap5 it doesn’t override the style.

HTML file

 <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <link rel="stylesheet" href="./Assests/reset.css">
    <link rel="stylesheet" href="./Assests/style.css">
</head>

<body>
    <header>
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
            <div class="container-fluid">

CSS file

.navbar {
    background-color: black;
}

Tried switching order of css and BS5 scripts. That just made everything worse. I also tried to add my own class names.

2

Answers


  1. Here is the override rules, hope to solve your problem.

    https://www.w3docs.com/snippets/css/how-to-override-css-styles.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search