0
0
Bootsrapmarkup~20 mins

Button groups in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Button Group 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 button group?
Look at the following HTML code using Bootstrap 5. What will you see rendered in the browser?
Bootsrap
<div class="btn-group" role="group" aria-label="Basic example">
  <button type="button" class="btn btn-primary">Left</button>
  <button type="button" class="btn btn-primary">Middle</button>
  <button type="button" class="btn btn-primary">Right</button>
</div>
AThree separate blue buttons spaced apart horizontally with no border connecting them.
BA vertical stack of three blue buttons with equal spacing between them.
CA horizontal group of three blue buttons touching each other with no gaps, forming a single connected shape.
DThree blue buttons arranged diagonally from top-left to bottom-right.
Attempts:
2 left
💡 Hint
Bootstrap's btn-group class groups buttons horizontally with no gaps.
selector
intermediate
1:30remaining
Which attribute ensures accessibility for a Bootstrap button group?
In Bootstrap button groups, which attribute is important to add for screen readers to understand the group?
Aaria-label
Bdata-toggle
Crole="button"
Dtabindex="0"
Attempts:
2 left
💡 Hint
Think about how screen readers identify groups of controls.
📝 Syntax
advanced
2:00remaining
What error occurs with this Bootstrap button group code?
Examine this code snippet. What error or problem will it cause when rendered?
Bootsrap
<div class="btn-group" aria-label="Group">
  <button class="btn btn-secondary">One</button>
  <button class="btn btn-secondary">Two</button>
  <button class="btn btn-secondary">Three</button>
</div>
AButtons will be grouped horizontally but will not be clickable.
BScreen readers will not recognize the buttons as a group because the role="group" attribute is missing.
CButtons will be grouped but have no color styling because btn-secondary is invalid.
DButtons will stack vertically because btn-group requires an extra class for horizontal layout.
Attempts:
2 left
💡 Hint
Bootstrap uses role="group" to identify button groups for assistive technologies.
layout
advanced
1:30remaining
How to create a vertical button group in Bootstrap?
Which class combination creates a vertical stack of buttons grouped together in Bootstrap 5?
AUse class="btn-group-vertical" on the container div.
BUse class="btn-group" and add CSS flex-direction: column manually.
CUse class="btn-vertical" on each button inside btn-group.
DUse class="btn-group" with role="vertical" attribute.
Attempts:
2 left
💡 Hint
Bootstrap provides a special class for vertical button groups.
🧠 Conceptual
expert
2:30remaining
Why use role="group" with aria-label in Bootstrap button groups?
What is the main reason to add role="group" and aria-label attributes to a Bootstrap button group container?
ATo make buttons responsive and adjust their size on different screen widths.
BTo enable Bootstrap's JavaScript to activate button toggling functionality.
CTo apply default Bootstrap styling for grouped buttons automatically.
DTo improve keyboard navigation and provide screen readers a clear description of the button group.
Attempts:
2 left
💡 Hint
Think about accessibility and how assistive devices interpret grouped controls.