Open In App

What is the use of breadcrumb-item Class in Bootstrap ?

Last Updated : 19 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

The .breadcrumb-item class in Bootstrap is utilized to style individual items within a breadcrumb navigation component. It defines the appearance of each breadcrumb item, providing visual cues to users about the hierarchical structure of the navigation path.

Bootstrap 5 Breadcrumb

  • Breadcrumb Variables: It changes the default values provided for the breadcrumb by customizing the SCSS file of Bootstrap 5.
  • Breadcrumb Dividers: It customizes the bootstrap 5 breadcrumb divider, the –bs-breadcrumb-divider custom CSS property, or the $breadcrumb-divider and $breadcrumb-divider-flipped Sass variables can be used.

Preview:

Syntax:

<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Library</a></li>
<li class="breadcrumb-item active" aria-current="page">Data</li>
</ol>

Explanation: Each breadcrumb item in the navigation is marked up using the <li> element with the .breadcrumb-item class. This class ensures consistent styling for breadcrumb items, typically displaying them as inline elements with appropriate spacing between items. Additionally, the .active class is used to denote the current page in the breadcrumb trail, while the aria-current="page" attribute provides accessibility information.

Features:

  • Provides consistent styling for individual items within a breadcrumb navigation component.
  • Ensures visual clarity and hierarchy in navigation paths.
  • Supports the creation of breadcrumb trails to indicate the user’s current location within a website.
  • Offers flexibility in customization and integration with other Bootstrap components.

Ref: https://www.geeksforgeeks.org/bootstrap-5-breadcrumb/


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads