Challenge - 5 Problems
Bootstrap Auto-sizing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Understanding Bootstrap Auto-sizing Columns
In Bootstrap, what does the
col-auto class do when applied to a column inside a .row?Attempts:
2 left
💡 Hint
Think about how columns behave when you want them to fit their content exactly.
✗ Incorrect
The col-auto class in Bootstrap sizes the column width automatically based on the content inside it. It does not stretch to fill the remaining space like col or col-* classes.
📝 Syntax
intermediate1:30remaining
Identify the Correct Bootstrap Auto-sizing Column Syntax
Which of the following HTML snippets correctly creates a Bootstrap row with one auto-sized column and one regular column that fills the rest of the space?
Attempts:
2 left
💡 Hint
Remember the exact Bootstrap class names for auto and flexible columns.
✗ Incorrect
Option D uses the correct Bootstrap classes: col-auto for auto-sized column and col for flexible column filling remaining space.
❓ rendering
advanced2:00remaining
Visual Result of Mixed Auto and Flexible Columns
What will you see in the browser when rendering this Bootstrap code?
<div class="row"> <div class="col-auto bg-primary text-white p-2">Short</div> <div class="col bg-secondary text-white p-2">This column fills the rest of the row</div> </div>
Bootsrap
<div class="row"> <div class="col-auto bg-primary text-white p-2">Short</div> <div class="col bg-secondary text-white p-2">This column fills the rest of the row</div> </div>
Attempts:
2 left
💡 Hint
Remember how
col-auto sizes to content and col fills remaining space.✗ Incorrect
The col-auto column sizes itself just enough for the 'Short' text with blue background. The col column fills the rest of the row with gray background.
❓ selector
advanced1:30remaining
CSS Selector for Auto-sized Bootstrap Columns
Which CSS selector correctly targets only the Bootstrap columns that are auto-sized with
col-auto class inside a .row?Attempts:
2 left
💡 Hint
Think about direct children with the class
col-auto inside .row.✗ Incorrect
The selector .row > .col-auto selects all elements with class col-auto that are direct children of elements with class row.
❓ accessibility
expert2:30remaining
Improving Accessibility for Auto-sized Columns
You have a Bootstrap row with multiple
col-auto columns containing buttons. What is the best way to improve keyboard navigation and screen reader accessibility for these auto-sized columns?Attempts:
2 left
💡 Hint
Grouping related interactive elements helps screen readers understand context.
✗ Incorrect
Adding role="group" and an aria-label to the container groups the buttons semantically, improving screen reader context and keyboard navigation.