Bootstrap Breadcrumb

Bootstrap breadcrumb specifies the current page location inside the navigational hierarchy. It enhances the accessibility of the website because it separates the navigation item with a separator.

Example

Steps To Create bootstrap 5 Breadcrumb :

  • Wrap <ol> (ordered list) inside <nav>.
  • Assign the .breadcrumb class to the <ol> element base class.
  • Add the .breadcrumb-item class to the <li> element base class.
  • To make breadcrumb item active, assign the .active class to the <li> element base class.

General Syntax

      <nav>
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="#!">Breadcrumb Item </a></li>
  </ol>
</nav>
  
Try it now

Source Code

          <div class="container mt-5-">
  <nav>
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="#!">Home</a></li>
      <li class="breadcrumb-item"><a href="#!">Shop</a></li>
      <li class="breadcrumb-item active">Account</li>
    </ol>
  </nav>
</div>
        
Try it now

Code Explanation

In this example, .breadcrumb is assigned to the breadcrumb container base class while .breadcrumb-item is assigned to the breadcrumb item base class.

Note! You have to focus on the .breadcrumb, .breadcrumb-item, and .active classes since these are used during breadcrumb creation.

Bootstrap Breadcrumb Custom Separator

Breadcrumb separator can be changed very easily by a custom property --bs-breadcrumb-divider.

Example

General Syntax

      <nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="#!">Home</a></li>
    <li class="breadcrumb-item active" aria-current="page">Library</li>
  </ol>
</nav>
  
Try it now

Source Code

          <div class="container mt-5-">
  <nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="#!">Home</a></li>
      <li class="breadcrumb-item active" aria-current="page">Library</li>
    </ol>
  </nav>
</div>
        
Try it now

Code Explanation

Note: In this example, the breadcrumb separator has been changed by a custom property --bs-breadcrumb-divider.

Online Test / Quiz

Web Tutorials

Bootstrap Breadcrumb
Html Tutorial HTML
Javascript Tutorial JAVASCRIPT
Css Tutorial CSS
Bootstrap 5 Tutorial BOOTSTRAP 5
Bootstrap 4 Tutorial BOOTSTRAP 4