Bootstrap 4 Breadcrumb |
Bootstrap 4 separators are automatically added through ::before and content property.
Let's see how to create an breadcrumb?
- Include a .breadcrumb class to your element whether it is a ordered list or unordered list.
- Add a .breadcrumb-item class, inside your each list element.
- Add a active class to your list element to indicate the users current page. This should be always the last list element.
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Bootstrap</a></li>
<li class="breadcrumb-item"><a href="#">Bootstrap 4</a></li>
<li class="breadcrumb-item active" aria-current="page">Breadcrumb</li>
</ol>
Demo
Breadcrumb (Colors)
Demo
See the Pen BOOTSTRAP 4 BREADCRUMB - DESIGNS by Prime Study
Breadcrumb (Icons)
Follow the below steps to include Bootstrap 4 breadcrumb with icons,- Add the font-awesome plugin to your site header. You can download your font-awesome plugin by click here.
- Next, customize the breadcrumb using the breadcrumb-item::before content like below,
.breadcrumb-item+.breadcrumb-item::before {
font-family: FontAwesome;
content: "\f101";
}
- Add the content based on your font-awesome content code. Click here to get the full list of font-awesome icon with content code.
- Finally, you need to change the font-family to FontAwesome for below font-awesome version 4. For font-awesome version 5, you need to use Font Awesome 5 Brands OR Font Awesome 5 Free font-family.
.breadcrumb-item+.breadcrumb-item::before {
font-family: "Font Awesome 5 Free";
content: "\f101";
}
Note: If you don't include the font-family, the font-awesome icons should not be displayed.
Comments