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?
<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>
Remember, col without a number means equal width columns.
Using col class without a number divides the row into equal parts for each column.
Which class should you use to make columns automatically share equal width in a row?
Look for the class that does not specify a fixed width.
The col class makes columns share equal width automatically.
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?
<div class="row"> <div class="col">A</div> <div class="col-6">B</div> <div class="col">C</div> </div>
Remember fixed width columns take specified space, others share leftover.
col-6 takes half the row width. The other two col share the remaining half equally.
You have equal-width columns using Bootstrap. What should you add to improve accessibility?
Think about how screen readers understand sections.
Adding aria-label helps screen readers describe the purpose of each column.
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.
Think about how flexbox distributes space among items.
The col class applies flexbox with equal flex-grow, so columns share available space equally regardless of content size.