A. The col-auto class is applied to the wrong column; it should be on 'Menu'.
B. The row class is missing from the container.
C. The col-auto class is correct; no mistake in code.
D. The col-auto class is correct but the container needs d-flex.
Solution
Step 1: Check class usage on columns
The 'Search' column has col-auto, so it will auto-size to content width as expected.
Step 2: Verify container and row classes
The container has row class, which is correct for Bootstrap grid layout.
Final Answer:
The col-auto class is correct; no mistake in code. -> Option C
Quick Check:
Correct use of col-auto and row [OK]
Hint: Check if col-auto is on correct column and row exists [OK]
Common Mistakes:
Thinking col-auto must be on first column
Forgetting row class on container
Adding unnecessary d-flex for grid columns
5. You want a Bootstrap row with three columns: the first and third columns auto-size to their content, and the middle column fills the remaining space. Which code snippet achieves this?
hard
A. <div class='row'>
<div class='col'>Left</div>
<div class='col-auto'>Center</div>
<div class='col'>Right</div>
</div>
B. <div class='row'>
<div class='col-auto'>Left</div>
<div class='col'>Center</div>
<div class='col-auto'>Right</div>
</div>
C. <div class='row'>
<div class='col'>Left</div>
<div class='col'>Center</div>
<div class='col-auto'>Right</div>
</div>
D. <div class='row'>
<div class='col-auto'>Left</div>
<div class='col-auto'>Center</div>
<div class='col-auto'>Right</div>
</div>
Solution
Step 1: Identify columns that auto-size
The first and third columns should have col-auto to fit their content width.
Step 2: Identify column that fills remaining space
The middle column should have col to fill leftover horizontal space.
Step 3: Match code snippet to requirements
<div class='row'>
<div class='col-auto'>Left</div>
<div class='col'>Center</div>
<div class='col-auto'>Right</div>
</div> matches this exactly: first and third columns use col-auto, middle uses col.