Overriding Bootstrap navigation styles

Having trouble overriding the default styling of my bootstrap navigation bar. I've tried using the !important tag in my CSS, but it's not working as expected. Any help would be greatly appreciated!

HTML:

<nav class="navbar navbar-expand-lg navbar-light">
    <div class="container-fluid">
        <a class="navbar-brand" href="#"> <img src="/Assets/logo.svg" class="me-5" alt="" height="80"> </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs- target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria- expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                <li class="nav-item"> <a class="nav-link active" aria-current="page" href="#">Home</a> </li>
                <li class="nav-item"> <a class="nav-link" href="#">Link</a> </li>
                <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
            Dropdown
          </a>
                    <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                        <li><a class="dropdown-item" href="#">Action</a></li>
                        <li><a class="dropdown-item" href="#">Another action</a></li>
                        <li>
                            <hr class="dropdown-divider">
                        </li>
                        <li><a class="dropdown-item" href="#">Something else here</a></li>
                    </ul>
                </li>
                <li class="nav-item"> <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a> </li>
            </ul>
        </div>
    </div>
</nav>

CSS

.navbar{
    background-color: #ffffff10 !important;  
    backdrop-filter: blur(12px) !important;  
    -webkit-backdrop-filter: blur(12px) !important;  
}

Answer №1

it seems like your CSS is functioning correctly, but you may not notice any changes on the screen because you need to add a background image behind the object.

view image description here

you can try this:

 body {
        background-image: url("https://www.lg.com/tr/images/TV/features/D04_TV-UHD-UM75-04-Quad-Core-Processor-Desktop.jpg");
    }
    .navbar
        {
            border:1px solid red;
    background-color: #ffffff10 !important;  
    
    backdrop-filter: blur(12px) !important;  
    -webkit-backdrop-filter: blur(12px) !important;  
}

here are some examples https://css-tricks.com/almanac/properties/b/backdrop-filter/ https://css-tricks.com/almanac/properties/b/backdrop-filter/

if you are unable to override the CSS class, you can use an ID selector since IDs take priority over classes.

#navbar
    { color:red;}

if I misunderstood your issue, please share a CodePen link or files for further assistance

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I'm having trouble extracting text from the HTML code for an unknown reason

My code seems to be working well until I attempt to use the .text function, resulting in an error message stating "list' object has no attribute 'text". Interestingly, when I apply .text to a single element within the same list, it works without ...

Executing a function with the initial click

Is there a way to run a function only on the first click, without having it run every time? I already have another function running on window.onload, so I can't use that. Both functions work fine independently, but not together. Right now, I'm ca ...

Is it possible to cache an html page and display it on the current page when reloading?

I have been attempting to design a webpage with links in a table that trigger modals when clicked. These links are added dynamically using Jquery. $("table").append('<tr><td><a href="#exampleModal" data-bs-t ...

Reset button for jQuery form to clear all inputted values

My form has a reset button that is supposed to clear all entered values, but it doesn't seem to be working properly. After checking the Firefox console tab for errors, I noticed an 'illegal character' error at the end of my jQuery script. C ...

A universal setting takes precedence over Vuetify divider colors

Since upgrading Vuetify from version 1.1.9 to 1.2.3, I have encountered a strange issue where all of my dividers appear much darker than before and different from the examples in the documentation. This is how it should look: https://i.sstatic.net/GnxzV. ...

Why is it not achievable to dynamically update the HTML DOM structure while `<!DOCTYPE html>` is specified?

The following HTML code is causing an issue: <!DOCTYPE html> <html> <head> <title>Clear a Timer</title> <meta charset="utf-8" /> <script> var theTimer, xPosition = 0, theImage; functio ...

What is the process for creating custom styles for MUIV5 components?

I have incorporated Mui v5 components into my project and currently I am utilizing sx props to style all the MUI components. However, it is becoming cumbersome to add sx in every line for each component. Therefore, I am seeking alternative methods for styl ...

Overlap of columns within a nested flexbox arrangement

While working with React and Styled Components, I encountered a problem of elements overlapping each other: https://i.stack.imgur.com/RuCYu.png There are a few instances of overlap, including: The padding below the <ul> element is colliding with ...

iOS is causing issues with the JavaScript function and not allowing it to

By creating an NSString that contains JavaScript, I am able to set the e-mail body. NSString * someString =@"<!DOCTYPE html>\n <html>\n <body> \n <h1>My Web Page</h1> \n <p ...

Having trouble with implementing a lightbox form data onto an HTML page using the load() function? Let me help

In my project, I have set up a lightbox containing a form where user inputs are used to populate an HTML file loaded and appended to the main HTML page with the load() function. While I can successfully load the data onto the page, I am facing challenges i ...

Stop browsers from automatically filling out fields that are hidden

Our method involves jQuery to conceal irrelevant fields based on previous responses. It's puzzling how the browser (Chrome) has somehow autofilled the user's email address into one of them even though autocomplete is disabled. The field's ID ...

Achieving effective targeting of the second segment within a string enclosed in a span tag through increased specificity

When it comes to styling elements, the easiest way is to use classes and assign the properties needed. However, 1. I'm not a huge fan of creating classes all over the place. That's what specificity and CSS mapping are for. 2. Going thro ...

Displaying data from a JSON object to a DOM table can be achieved by dynamically generating table columns based on the keys within

There is a JSON object that I'm working with: [ { "SysID": "4", "Defect Classification": "Wrong Image Color", "1": "3.0", "2": "", "3": " ...

What is the solution to having a div move along with window resizing without displacing adjacent divs?

After much effort, I still can't seem to get this working correctly. I've been playing around with a section named "RightExtra" and a div inside it called "RightExtraContent". My goal is to allow these two divs to move freely when the window is ...

Is it possible to use an SVG image as a border with a variable height in CSS

Check out this jsfiddle for my current project's nav setup. I want to center the logo in the middle of the nav with three links centered around it. However, I need the design to be responsive across various screen widths. Any advice on how to achieve ...

Chrome's Surprising Cross-Domain File URL Problem

Is anyone else experiencing the issue with Chrome throwing a Cross Domain Error when using file URLs? I'm trying to embed an SVG document into an HTML page using the object tag with a relative path in the data attribute. Upon the onload event, I need ...

The Stylish Choice: Materialize CSS Dropdown Selector

I am currently integrating Materialize CSS into my application and have used media queries to ensure that the layout is responsive. However, I am facing an issue with a select dropdown element. It works fine on laptops but does not allow for selecting any ...

What is the reason that the CSS3 property name 'filter' is not recognized in Windows 8 applications?

I'm in the process of adapting my own codepen for a Windows 8 desktop app. Everything runs smoothly on Codepen, with the exception of some CSS adjustments from -webkit- to -ms-. However, I encountered an issue regarding this specific line in the CSS s ...

Calculator built with HTML, CSS, and JavaScript

Hi there, I'm experiencing some issues with my calculator. The buttons seem to be working fine and lining up correctly, but for some reason, nothing is showing up on the monitor or getting calculated when I press the buttons. Here's the code that ...

Bootstrap is causing issues with unidentified div elements

I recently embarked on creating a slideshow using HTML, CSS, and jQuery. After completing the slideshow, I decided to add an interactive page beneath it. To streamline the layout process, I opted to utilize Bootstrap. However, upon loading Bootstrap, I en ...