π Objective: Learn how to use Bootstrapβs Breadcrumbs & Pagination components to improve navigation and user experience.
πΉ 1. Introduction to Breadcrumbs & Pagination
Breadcrumbs and pagination help users navigate large websites efficiently.
π‘ Why Use Breadcrumbs & Pagination?
βοΈ Breadcrumbs show the userβs current location within the site.
βοΈ Pagination divides large content into multiple pages for better usability.
πΉ 2. Bootstrap Breadcrumbs
Breadcrumbs display hierarchical navigation, helping users track their path on a website.
β Example: Simple Breadcrumb Navigation
πΉ What happens?
- The breadcrumb links show the navigation hierarchy.
- The current page (“Article”) is bold and non-clickable.
1οΈβ£ Breadcrumb with Icons
β Example: Breadcrumb with Icons
πΉ What happens?
- Icons are added next to breadcrumb items.
2οΈβ£ Styling Breadcrumbs with Backgrounds
β Example: Colored Breadcrumbs
πΉ What happens?
- The breadcrumb has a light background (
bg-light). - The current page is highlighted in blue (
text-primary).
πΉ 3. Bootstrap Pagination
Pagination helps users navigate large datasets by breaking them into multiple pages.
β Example: Simple Pagination
πΉ What happens?
- Users navigate between multiple pages using numbered links.
1οΈβ£ Pagination with Active & Disabled States
β Example: Pagination with Active Page & Disabled Button
πΉ What happens?
- The “Previous” button is disabled.
- The current page (
2) is highlighted as active.
2οΈβ£ Pagination with Icons
β Example: Pagination Using Icons
πΉ What happens?
- The “Previous” and “Next” buttons have arrow icons instead of text.
3οΈβ£ Large & Small Pagination
β Example: Small & Large Pagination
πΉ What happens?
- The first pagination is large (
pagination-lg). - The second pagination is small (
pagination-sm).
4οΈβ£ Centered Pagination
β Example: Centering Pagination
πΉ What happens?
- The pagination is centered (
justify-content-center).
π Lesson Recap Quiz
π― Test your knowledge of Bootstrap Breadcrumbs & Pagination.
π Multiple-Choice Questions (MCQs)
1οΈβ£ What Bootstrap class is used for breadcrumbs?
a) .breadcrumb-bar
b) .breadcrumb
c) .nav-breadcrumb
d) .breadcrumb-list
β
Correct Answer: b) .breadcrumb
2οΈβ£ How do you highlight the current breadcrumb item?
a) .breadcrumb-current
b) .active
c) .highlighted
d) .breadcrumb-selected
β
Correct Answer: b) .active
3οΈβ£ What Bootstrap class is used for pagination links?
a) .pagination-list
b) .pagination
c) .pager
d) .nav-pagination
β
Correct Answer: b) .pagination
π True or False
4οΈβ£ Bootstrap pagination can be made larger or smaller using .pagination-lg or .pagination-sm.
β
Answer: True
5οΈβ£ Breadcrumbs automatically track a userβs navigation.
β
Answer: False (Breadcrumbs need to be manually set up.)
π― Practical Challenge
β Create a breadcrumb navigation with:
- Icons for each breadcrumb item
- A highlighted active page
β Build a pagination component with: - “Previous” and “Next” buttons
- Centered alignment (
justify-content-center) - An active page indicator
β Post your solution in the discussion forum for feedback!
π Lesson Summary
β
Breadcrumbs (.breadcrumb) improve website navigation.
β
Pagination (.pagination) divides large datasets into pages.
β
.active highlights the current page or breadcrumb.
β
.pagination-lg and .pagination-sm adjust the pagination size.