0
0
Bootsrapmarkup~20 mins

Close button component in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Close Button Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
What is the visual output of this Bootstrap close button code?
Look at the following HTML code using Bootstrap 5. What will you see in the browser?
Bootsrap
<button type="button" class="btn-close" aria-label="Close"></button>
AA small square button with an 'X' icon aligned to the right side, no text visible.
BA button with a visible checkbox inside it.
CA large button with the text 'Close' inside it.
DA button with a circle and a plus '+' sign inside.
Attempts:
2 left
💡 Hint
Bootstrap's close button uses a small icon with no text by default.
accessibility
intermediate
2:00remaining
Which attribute ensures the close button is accessible to screen readers?
Given a Bootstrap close button, which attribute helps screen readers understand its purpose?
Bootsrap
<button type="button" class="btn-close" ???></button>
Arole="button"
Btitle="Close Button"
Caria-label="Close"
Dalt="Close"
Attempts:
2 left
💡 Hint
Screen readers use aria-label to describe buttons without visible text.
📝 Syntax
advanced
2:00remaining
What error occurs with this close button code?
Identify the error in this Bootstrap close button code snippet:
Bootsrap
<button type="button" class="btn-close" aria-label="Close"></button>
ASyntaxError: Unexpected closing tag '</btn>'
BAccessibility warning: missing aria-label
CTypeError: class 'btn-close' not found
DNo error, renders correctly
Attempts:
2 left
💡 Hint
Check if all HTML tags are properly opened and closed.
layout
advanced
2:00remaining
How to position a Bootstrap close button at the top-right corner of a modal?
Which CSS class combination correctly places the close button at the top-right inside a Bootstrap modal header?
Bootsrap
<div class="modal-header">
  <h5 class="modal-title">Modal title</h5>
  <button type="button" class="???" aria-label="Close"></button>
</div>
Abtn-close float-end
Bbtn-close me-auto
Cbtn-close float-start
Dbtn-close ms-auto
Attempts:
2 left
💡 Hint
Use margin utilities to push the button to the right.
🧠 Conceptual
expert
3:00remaining
What happens if you omit the aria-label on a Bootstrap close button?
Consider a close button with class 'btn-close' but no aria-label attribute. What is the impact on accessibility?
Bootsrap
<button type="button" class="btn-close"></button>
AThe button will not render visually in the browser.
BScreen readers may not announce the button's purpose, causing confusion for users relying on assistive technology.
CThe button will automatically inherit the label 'Close' from Bootstrap CSS.
DThe button will cause a JavaScript error when clicked.
Attempts:
2 left
💡 Hint
Think about how screen readers identify buttons without visible text.