According to Bootstrap's Documentation, the active
item in breadcrumbs should not have a link inside.
It makes sense as the last item usually represents the current active page and should not be clickable, hence the <a>
element is unnecessary.
Follow the standard Bootstrap structure for breadcrumbs like this:
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#">Library</a></li>
<li class="active">Data</li>
</ol>
There are two ways to change the color of the active text:
Method #01:
- Visit the Customizing Bootstrap page.
- Go to the Breadcrumbs section.
- Replace the default value of
@breadcrumb-active-color
variable with your desired value, e.g. #000
.
- Go to the Download section and click on "Compile and Download" Button.
Method #02:
You can override Bootstrap styles in your custom CSS file.
.breadcrumb >.active {
color: black;
}
If you still want a link inside the active
item, you can modify the selector like this:
.breadcrumb >.active a {
color: black;
}
@import url("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css");
.breadcrumb > .active,
.breadcrumb > .active a {
color: black;
}
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#">Library</a></li>
<li class="active">Data(Without Link)</li>
</ol>
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li><a href="#">Library</a></li>
<li class="active"><a href="#">Data(With Link)</a></li>
</ol>