Breadcrumbs
Breadcrumbs show the path to the current page and let visitors jump back up the hierarchy.
In this page:
Syntax
<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
<!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
- Making the current page a link
- Missing aria-label
- 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: