At the moment i am using this template: http://getbootstrap.com/examples/navbar-fixed-top/
Is there any way to give the background in the dropdownmenu (The one that pops up, when the navbar collapses) another color than the navbar itself?
What i tried so far is this, without success:
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
Bootstrap 4 has an inbuilt class '. show' which is added to the navbar item when the dropdown menu expanded and the class is hidden when the dropdown menu when it is collapsed. The color of the dropdown can be changed using the show class.
To change the dropdown button color:Wrap your DropdownButton inside the Container . Inside the Container , add the decoration property and assign the BoxDecoration widget. Inside the BoxDecoration add the color property and assign the color of your choice. Run the app.
We can add background color to a div by simply adding class “bg-primary”, “bg-success”, “bg-danger”, “bg-info”, and many more as shown in the following examples.
Use this
.navbar-nav > li > .dropdown-menu { background-color: #FF0000; }
To get the background color of Bootstrap Navigation Menu dropdowns
.navbar-nav > li > .dropdown-menu a:link,
.navbar-nav > li > .dropdown-menu a:hover { background-color: #FF0000;}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With