Challenge - 5 Problems
Bootstrap Pagination Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual output of this Bootstrap pagination code?
Look at the following Bootstrap pagination HTML snippet. What will you see rendered in the browser?
Bootsrap
<nav aria-label="Page navigation example"> <ul class="pagination"> <li class="page-item"><a class="page-link" href="#">Previous</a></li> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item active" aria-current="page"><a class="page-link" href="#">2</a></li> <li class="page-item"><a class="page-link" href="#">3</a></li> <li class="page-item"><a class="page-link" href="#">Next</a></li> </ul> </nav>
Attempts:
2 left
💡 Hint
Bootstrap pagination uses horizontal layout by default and highlights the active page with a special style.
✗ Incorrect
The 'pagination' class creates a horizontal list. The 'active' class on the second page item highlights page 2. 'Previous' and 'Next' are normal links on the sides.
❓ accessibility
intermediate2:00remaining
Which attribute improves accessibility in this pagination component?
In the Bootstrap pagination example, which attribute helps screen readers understand the current page?
Bootsrap
<nav aria-label="Page navigation example"> <ul class="pagination"> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item active" aria-current="page"><a class="page-link" href="#">2</a></li> <li class="page-item"><a class="page-link" href="#">3</a></li> </ul> </nav>
Attempts:
2 left
💡 Hint
Screen readers use specific ARIA attributes to identify the current page.
✗ Incorrect
The attribute aria-current="page" explicitly tells assistive technologies which page is active. The class 'active' is for styling only. The href attribute is for links. The aria-label on nav describes the navigation region but does not mark the current page.
📝 Syntax
advanced2:00remaining
What error occurs with this incorrect Bootstrap pagination HTML?
This snippet has a mistake. What happens when you try to render it in a browser?
Bootsrap
<nav aria-label="Page navigation"> <ul class="pagination"> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item active" aria-current="page"><a class="page-link" href="#">2</a></li> <li class="page-item"><a class="page-link" href="#">3</a></li> </ul> </nav>
Attempts:
2 left
💡 Hint
Browsers try to fix missing closing tags but the HTML is invalid.
✗ Incorrect
The first tag is missing its closing . Browsers will still render but the HTML is invalid and may cause layout issues. There is no JavaScript error here. CSS classes are present so styling applies.
❓ layout
advanced2:00remaining
How to center the Bootstrap pagination horizontally on the page?
Given this pagination, which CSS class or style centers it horizontally?
Bootsrap
<nav aria-label="Page navigation example"> <ul class="pagination"> <li class="page-item"><a class="page-link" href="#">Previous</a></li> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item active" aria-current="page"><a class="page-link" href="#">2</a></li> <li class="page-item"><a class="page-link" href="#">3</a></li> <li class="page-item"><a class="page-link" href="#">Next</a></li> </ul> </nav>
Attempts:
2 left
💡 Hint
Bootstrap uses flexbox utilities to align pagination items.
✗ Incorrect
The class "justify-content-center" on the
- with class "pagination" centers the pagination horizontally using flexbox. Text-align center on nav won't center flex items. mx-auto on nav won't center the inner flex container. Margin auto on
- won't center flex items inside it.
🧠 Conceptual
expert2:00remaining
What is the effect of adding 'disabled' class to a Bootstrap pagination item?
Consider this pagination item: Previous . What does the 'disabled' class do?
Bootsrap
<nav aria-label="Page navigation example"> <ul class="pagination"> <li class="page-item disabled"><a class="page-link" href="#">Previous</a></li> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item active" aria-current="page"><a class="page-link" href="#">2</a></li> <li class="page-item"><a class="page-link" href="#">3</a></li> <li class="page-item"><a class="page-link" href="#">Next</a></li> </ul> </nav>
Attempts:
2 left
💡 Hint
Bootstrap disables pointer events and changes style for disabled pagination items.
✗ Incorrect
The 'disabled' class applies styles that gray out the item and disables pointer events so the link cannot be clicked. The link remains in the DOM but is not interactive. No tooltip is added automatically.