In Bootstrap 4 Breadcrumbs Tutorial With Example, you will learn how to create a breadcrumb in Bootstrap 4. A breadcrumb is a navigation scheme that indicates the current page’s location to the user within an application or website.

Bootstrap 4 Breadcrumbs Tutorial With Example

Bootstrap 4 provides the .breadcrumb class which styles a list into a breadcrumb. Breadcrumbs work similarly to regular pagination, except that they are often used to display the hierarchy between page categories.

#1: Bootstrap 4 Breadcrumbs

Breadcrumb navigation can hugely enhance the accessibility of the websites having large numbers of pages. There are the three basic CSS classes used in Bootstrap 4 breadcrumb.

  • .breadcrumb – To know the listed items to be shown in a breadcrumb style.
  • .breadcrumb-item – To list down all items of the breadcrumb.
  • .breadcrumb-item active – To know the active page on the breadcrumb structure.

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap 4 Breadcrumbs Tutorial With Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
<h2>Breadcrumbs</h2>
<ul class="breadcrumb">
    <li class="breadcrumb-item"><a href="#">India</a></li>
    <li class="breadcrumb-item"><a href="#">Karnataka</a></li>
    <li class="breadcrumb-item active">Bangalore</li>
  </ul>
</div>
</body>
</html>

The example of Bootstrap breadcrumb will look like below screenshot.

Bootstrap 4 Breadcrumbs Example

At last, our Bootstrap 4 Breadcrumbs Tutorial With Example is over.

Post Your Thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.