0
0
Bootsrapmarkup~20 mins

Auto-sizing columns in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Auto-sizing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Bootstrap Auto-sizing Columns
In Bootstrap, what does the col-auto class do when applied to a column inside a .row?
AIt sizes the column based on its content width, not filling the remaining space.
BIt makes the column take up the entire width of the row.
CIt fixes the column width to 100 pixels regardless of content.
DIt hides the column on small screens.
Attempts:
2 left
💡 Hint
Think about how columns behave when you want them to fit their content exactly.
📝 Syntax
intermediate
1: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?
A
<div class="row">
  <div class="auto-col">Auto</div>
  <div class="fill-col">Fill</div>
</div>
B
<div class="row">
  <div class="col">Auto</div>
  <div class="col-auto">Fill</div>
</div>
C
<div class="row">
  <div class="col-auto-auto">Auto</div>
  <div class="col-fill">Fill</div>
</div>
D
<div class="row">
  <div class="col-auto">Auto</div>
  <div class="col">Fill</div>
</div>
Attempts:
2 left
💡 Hint
Remember the exact Bootstrap class names for auto and flexible columns.
rendering
advanced
2: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>
ATwo equal width boxes side by side, both filling half the row.
BOnly the gray box is visible filling the entire row; the blue box is hidden.
CA small blue box with 'Short' sized to content on left, and a larger gray box filling the rest of the row on right.
DOne full-width blue box with 'Short' text, and the gray box below it filling the row.
Attempts:
2 left
💡 Hint
Remember how col-auto sizes to content and col fills remaining space.
selector
advanced
1: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?
A.col-auto .row
B.row > .col-auto
C.row .col:not(.col-auto)
D.col-auto > .row
Attempts:
2 left
💡 Hint
Think about direct children with the class col-auto inside .row.
accessibility
expert
2: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?
AAdd <code>role="group"</code> to the row and use <code>aria-label</code> to describe the group of buttons.
BAdd <code>tabindex="-1"</code> to all buttons to skip them in keyboard navigation.
CRemove all ARIA attributes and rely on default Bootstrap styles.
DWrap each button in a <code>&lt;div&gt;</code> with no ARIA attributes.
Attempts:
2 left
💡 Hint
Grouping related interactive elements helps screen readers understand context.