Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap 3 navbar branding colour

I am using the bootstrap 3 navbar but cant for some reason change the brand text colour nor the dropdown triangles. i've tried a couple of things, but still no luck...

 .navbar .nav > .navbar-brand > a {
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
    color:  #d6d6d6;
 }

.navbar-brand {
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
    color:  #d6d6d6;
}

.navbar-brand a{
     text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
     color:  #d6d6d6;
}
like image 799
user1949366 Avatar asked Aug 30 '13 13:08

user1949366


People also ask

How do I change the active navbar color in Bootstrap?

There are two ways that you can change the font color of the active nav-item. The default font-color is white of the active nav-link in the case of Bootstrap nav-active item. The first-way approach is to use a CSS styling file and changing the nav-item class when clicked.

How do I change the color of my navbar links?

bg-color classes to add a background color to the navbar. Tip: Add a white text color to all links in the navbar with the . navbar-dark class, or use the . navbar-light class to add a black text color.


2 Answers

This is a specificity issue. The declaration contained in Bootstrap's CSS is more specific than yours. Please write your declaration this way:

.navbar-default .navbar-brand {
    color: #d6d6d6;
}

Simply using .navbar-brand is less specific and thus ignored. You may read a little bit about specificity here.

like image 131
mingos Avatar answered Sep 29 '22 23:09

mingos


In the bootstrap.css file:

.navbar-default .navbar-brand {
  color: #777777;
}

is where the Brand text color is set. I changed that to color: #ff0000 and it successfully changed to red. To change the color of the dropdown triangle,change values of color here

.navbar-default .navbar-nav > .dropdown > a .caret {
  border-top-color: #777777;
  border-bottom-color: #777777;
}

For different colors on hover etc for the dropdown triangles:

.navbar-default .navbar-nav > .dropdown > a:hover .caret,
.navbar-default .navbar-nav > .dropdown > a:focus .caret {
  border-top-color: #333333;
  border-bottom-color: #333333;
}

.navbar-default .navbar-nav > .open > a .caret,
.navbar-default .navbar-nav > .open > a:hover .caret,
.navbar-default .navbar-nav > .open > a:focus .caret {
  border-top-color: #ff0000;
  border-bottom-color: #ff0000;
}
like image 38
Gloria Avatar answered Sep 29 '22 22:09

Gloria