📖 Scenario: You are building a website navigation aid called a breadcrumb. It shows users the path they took to reach the current page. This helps users understand where they are and easily go back to previous pages.
🎯 Goal: Create a breadcrumb navigation bar using Bootstrap 5 that shows the path: Home > Library > Data.
📋 What You'll Learn
Use Bootstrap 5 breadcrumb component structure
Include three breadcrumb items: Home, Library, and Data
Make Home and Library clickable links
Make Data the current page and not a link
Use semantic HTML and accessibility attributes
💡 Why This Matters
🌍 Real World
Breadcrumbs help users understand their location on a website and navigate easily back to previous pages.
💼 Career
Web developers often build navigation components like breadcrumbs to improve user experience and accessibility.
Progress0 / 4 steps
1
Create the basic HTML structure
Write the basic HTML5 skeleton with lang="en", meta charset="UTF-8", and meta viewport tags. Inside the <body>, add a <nav> element with aria-label="breadcrumb". Inside the <nav>, add an ordered list <ol> with class breadcrumb.
Bootsrap
Hint
Start by writing the HTML5 page structure and add a <nav> with aria-label="breadcrumb". Inside it, add an ordered list with class breadcrumb.
2
Add breadcrumb items for Home and Library
Inside the <ol class="breadcrumb">, add two list items. The first list item should be a link with text Home and href #. The second list item should be a link with text Library and href #. Both list items should have class breadcrumb-item.
Bootsrap
Hint
Use <li> with class breadcrumb-item for each item. Inside each <li>, add an <a> tag with href # and the correct text.
3
Add the current page breadcrumb item
Add a third list item inside the <ol class="breadcrumb"> with class breadcrumb-item active. The text should be Data. Add the attribute aria-current="page" to this list item. Do not make this item a link.
Bootsrap
Hint
The current page breadcrumb item should have class breadcrumb-item active and attribute aria-current="page". It should not be a link.
4
Add Bootstrap CSS link for styling
Inside the <head> section, add a <link> tag to include Bootstrap 5 CSS from the official CDN: https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css. Use the attributes rel="stylesheet" and integrity="sha384-9ndCyUa6mY5y0v+0U5r5b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6" and crossorigin="anonymous" exactly as shown.
Bootsrap
Hint
Include the Bootstrap CSS link inside the <head> to style the breadcrumb properly.
Practice
(1/5)
1. What is the main purpose of a Bootstrap breadcrumb component on a website?
easy
A. To create a navigation menu with dropdowns
B. To add buttons for form submission
C. To display images in a carousel format
D. To show the user's current location within the website's page hierarchy
Solution
Step 1: Understand breadcrumb purpose
Breadcrumbs help users know where they are on a website by showing the path they took.
Step 2: Match purpose with options
Only To show the user's current location within the website's page hierarchy describes showing the user's location in the page hierarchy.
Final Answer:
To show the user's current location within the website's page hierarchy -> Option D
Quick Check:
Breadcrumb = User location path [OK]
Hint: Breadcrumbs show navigation path, not menus or buttons [OK]
Common Mistakes:
Confusing breadcrumbs with navigation menus
Thinking breadcrumbs are for images or buttons
2. Which of the following is the correct HTML structure to start a Bootstrap breadcrumb for accessibility?
easy
A.
B.
C.
D.
Solution
Step 1: Identify Bootstrap breadcrumb container
Bootstrap requires a
Step 2: Compare options with correct structure
Only uses
Final Answer:
<nav aria-label="breadcrumb"><ol class="breadcrumb"></ol></nav> -> Option A
Quick Check:
Use <nav aria-label="breadcrumb"> + <ol class="breadcrumb"> [OK]
Hint: Breadcrumb uses
Common Mistakes:
Using <ul> instead of <ol>
Missing aria-label for accessibility
Using <div> instead of <nav>
3. Given this Bootstrap breadcrumb code, what will be the visual output in the browser?
B. The active breadcrumb item should not contain a link and must have aria-current="page"
C. The breadcrumb-item class is missing on the second <li>
D. The <nav> element is missing aria-label
Solution
Step 1: Check active breadcrumb rules
The active breadcrumb item must not be a link and must have aria-current="page" for accessibility.
Step 2: Identify errors in code
The active item has a link and lacks aria-current="page", which is incorrect.
Final Answer:
The active breadcrumb item should not contain a link and must have aria-current="page" -> Option B
Quick Check:
Active item = plain text + aria-current="page" [OK]
Hint: Active breadcrumb = plain text + aria-current="page" [OK]
Common Mistakes:
Putting a link inside the active breadcrumb item
Forgetting aria-current="page" on active item
Using <ul> instead of <ol> for breadcrumb
5. You want to create a breadcrumb with these pages: Home > Products > Electronics > Cameras, where 'Cameras' is the current page. Which code snippet correctly implements this with Bootstrap's breadcrumb component and accessibility best practices?
hard
A.
B.
C.
D.
Solution
Step 1: Check breadcrumb structure and accessibility
Use
Step 2: Evaluate each option
correctly uses
Final Answer:
Option A code snippet correctly implements Bootstrap breadcrumb with accessibility -> Option A
Quick Check:
Active item = plain text + aria-current="page" + correct container [OK]
Hint: Active breadcrumb: plain text + aria-current="page" inside
Common Mistakes:
Using <ul> instead of <ol>
Active breadcrumb as a link
Missing aria-current="page" on active item
Missing aria-label on <nav>
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.