bootstrap
  1. bootstrap-breadcrumb

Bootstrap Breadcrumb

  • Bootstrap Breadcrumb is a navigation component that helps users understand the hierarchy of a website or application.
  • Breadcrumb is a simple and effective way to enhance the navigation experience for users.

Syntax

To use Bootstrap Breadcrumb, you need to add the following HTML code in your body section:

<nav aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="#">Home</a></li>
    <li class="breadcrumb-item"><a href="#">Category</a></li>
    <li class="breadcrumb-item active" aria-current="page">Product</li>
  </ol>
</nav>

Example

In this example, we will create a breadcrumb that shows the navigation path to a product page.

<nav aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="#">Home</a></li>
    <li class="breadcrumb-item"><a href="#">Electronics</a></li>
    <li class="breadcrumb-item active" aria-current="page">Mobile Phones</li>
  </ol>
</nav>
Try Playground

Explanation

In the example above, we used the following classes to create the breadcrumb:

  • breadcrumb: this is the main class that indicates that this is a breadcrumb.
  • breadcrumb-item: this class is applied to each breadcrumb item.
  • active: this class is applied to the last breadcrumb item or the current page.
  • aria-current="page": this attribute is used to tell screen readers that the current item is the active page.

Use

Breadcrumb is useful for websites and applications with deep hierarchies, as it provides a clear and intuitive navigation path for users. You can use it in a variety of applications, including eCommerce websites, blogs, and content-heavy websites.

Important Points

  • Bootstrap Breadcrumb is a navigation component that helps users understand the hierarchy of a website or application.
  • Breadcrumb is easy to use and provides a clear and intuitive navigation path for users.
  • You can use Bootstrap Breadcrumb in a variety of applications, including eCommerce websites, blogs, and content-heavy websites.

Summary

Bootstrap Breadcrumb is a useful and simple tool for improving the navigation experience for users. By using Bootstrap Breadcrumb, you can enhance the usability of your website or application and help users find the content they are looking for more easily.

Published on: