0
0
Bootsrapmarkup~20 mins

Equal-width columns in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap Equal-Width Columns Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
layout
intermediate
2:00remaining
What is the output of this Bootstrap grid code?

Consider this Bootstrap 5 code snippet:

<div class="container">
  <div class="row">
    <div class="col">Column 1</div>
    <div class="col">Column 2</div>
    <div class="col">Column 3</div>
  </div>
</div>

How will the columns be displayed on a large screen?

Bootsrap
<div class="container">
  <div class="row">
    <div class="col">Column 1</div>
    <div class="col">Column 2</div>
    <div class="col">Column 3</div>
  </div>
</div>
AThree columns of equal width side by side in one row
BThree columns stacked vertically, each full width
CFirst column twice as wide as the other two
DColumns with widths based on content size
Attempts:
2 left
💡 Hint

Remember, col without a number means equal width columns.

selector
intermediate
1:30remaining
Which Bootstrap class creates equal-width columns?

Which class should you use to make columns automatically share equal width in a row?

Acol-sm-6
Bcol-12
Ccol-auto
Dcol
Attempts:
2 left
💡 Hint

Look for the class that does not specify a fixed width.

rendering
advanced
2:30remaining
What happens if you mix col and col-6 in the same row?

Given this code:

<div class="row">
  <div class="col">A</div>
  <div class="col-6">B</div>
  <div class="col">C</div>
</div>

How will the columns be sized on a large screen?

Bootsrap
<div class="row">
  <div class="col">A</div>
  <div class="col-6">B</div>
  <div class="col">C</div>
</div>
AB takes full width, A and C stack below
BAll three columns have equal width
CA and C share remaining space equally, B takes half the row width
DA takes 6 columns, B and C share remaining space
Attempts:
2 left
💡 Hint

Remember fixed width columns take specified space, others share leftover.

accessibility
advanced
2:00remaining
How to make equal-width columns accessible for screen readers?

You have equal-width columns using Bootstrap. What should you add to improve accessibility?

ANo accessibility attributes are needed for columns
BAdd <code>aria-label</code> describing each column's content
CAdd <code>tabindex="-1"</code> to columns
DUse <code>role="presentation"</code> on columns
Attempts:
2 left
💡 Hint

Think about how screen readers understand sections.

🧠 Conceptual
expert
3:00remaining
Why does using only col classes create equal-width columns regardless of content?

Explain why Bootstrap's col class automatically makes columns equal width even if their content sizes differ.

ABecause <code>col</code> uses flexbox with <code>flex: 1 0 0%</code> making all columns grow equally
BBecause <code>col</code> sets fixed pixel widths for all columns
CBecause <code>col</code> uses table layout forcing equal widths
DBecause <code>col</code> hides overflow content to equalize widths
Attempts:
2 left
💡 Hint

Think about how flexbox distributes space among items.