Challenge - 5 Problems
Bootstrap Button Size Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What size will this Bootstrap button render?
Given the following button code, what size will the button appear in the browser?
Bootsrap
<button type="button" class="btn btn-primary btn-lg">Click me</button>
Attempts:
2 left
💡 Hint
Look at the class that controls size: btn-lg means large.
✗ Incorrect
The class btn-lg in Bootstrap makes the button large. Without it, buttons are medium sized by default.
🧠 Conceptual
intermediate1:30remaining
Which class sets a small Bootstrap button?
Which Bootstrap class should you add to a button to make it smaller than the default size?
Attempts:
2 left
💡 Hint
Bootstrap uses btn-sm for small buttons, not btn-xs or others.
✗ Incorrect
The correct class for a small button in Bootstrap is btn-sm. Other classes like btn-xs or btn-mini are not valid in Bootstrap 5.
📝 Syntax
advanced2:00remaining
What error occurs with this button size class?
What happens if you use this button code in Bootstrap 5?
<button class="btn btn-primary btn-xs">Click</button>
Bootsrap
<button class="btn btn-primary btn-xs">Click</button>
Attempts:
2 left
💡 Hint
Bootstrap 5 does not have btn-xs class.
✗ Incorrect
The class btn-xs is not defined in Bootstrap 5. The button will ignore it and render with default size.
❓ selector
advanced1:30remaining
Which CSS selector targets all large Bootstrap buttons?
Which CSS selector will select all buttons with the large size class in Bootstrap?
Attempts:
2 left
💡 Hint
Look for buttons that have both btn and btn-lg classes.
✗ Incorrect
The selector button.btn-lg selects all <button> elements with the class btn-lg. Other options select descendants or are invalid.
❓ accessibility
expert2:30remaining
How to make a large Bootstrap button accessible?
You have a large button with class
btn-lg. What should you add to improve accessibility for screen readers?Bootsrap
<button class="btn btn-primary btn-lg">Submit</button>
Attempts:
2 left
💡 Hint
Screen readers need clear descriptions of button actions.
✗ Incorrect
Adding aria-label gives screen readers a clear description of what the button does. tabindex="-1" removes keyboard focus which harms accessibility. role="presentation" hides the button from assistive tech, which is wrong. Inline styles do not improve accessibility.