← Back to Bootstrap Course | Chapter 6: Components — Navigation | Lesson 6 of 7

Breadcrumbs

Breadcrumbs show the path to the current page and let visitors jump back up the hierarchy.

In this page:

  1. Breadcrumbs
Syntax
markup
<nav aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="#">Home</a></li>
    <li class="breadcrumb-item active" aria-current="page">Current</li>
  </ol>
</nav>

Breadcrumbs

Use nav with aria-label="breadcrumb" containing an ol.breadcrumb of li.breadcrumb-item elements. The last item gets .active and aria-current="page". Separators are added by CSS and can be changed with a CSS variable.

Note: Breadcrumbs are for hierarchy, not for browsing history.

Example: Breadcrumbs

markup
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="p-3">
<div class="container">
  <nav aria-label="breadcrumb">
    <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>
  </nav>
</div>
</body>
</html>
Live Example
Related Topics
Common Mistakes
  1. Making the current page a link
  2. Missing aria-label
  3. Using ul instead of ol
Chapter Summary
  • nav with aria-label breadcrumb
  • ol.breadcrumb and li.breadcrumb-item
  • Last item is active
  • Separators are CSS-generated
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.