Challenge - 5 Problems
Bootstrap Nesting Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual layout of nested Bootstrap columns?
Consider the following Bootstrap HTML code. What will be the visual arrangement of the colored boxes when rendered in a browser?
<div class="container">
<div class="row">
<div class="col-6 bg-primary text-white p-3">Left Column</div>
<div class="col-6">
<div class="row">
<div class="col-6 bg-success text-white p-3">Nested Left</div>
<div class="col-6 bg-warning p-3">Nested Right</div>
</div>
</div>
</div>
</div>Bootsrap
<div class="container"> <div class="row"> <div class="col-6 bg-primary text-white p-3">Left Column</div> <div class="col-6"> <div class="row"> <div class="col-6 bg-success text-white p-3">Nested Left</div> <div class="col-6 bg-warning p-3">Nested Right</div> </div> </div> </div> </div>
Attempts:
2 left
💡 Hint
Remember that nesting a row inside a column creates a new horizontal group inside that column.
✗ Incorrect
The outer row has two columns each taking half the width (col-6). The right column contains a nested row with two columns each taking half the width of that nested row. So visually, the left half is a blue box, and the right half is split into two smaller boxes side by side with green and yellow backgrounds.
❓ selector
intermediate1:30remaining
Which Bootstrap class is required to nest columns properly?
You want to nest columns inside another column in Bootstrap. Which class must you add to the container wrapping the nested columns to ensure proper alignment and spacing?
Attempts:
2 left
💡 Hint
Nested columns must be inside a horizontal grouping container.
✗ Incorrect
In Bootstrap, to nest columns inside a column, you must wrap the nested columns inside a div with the class 'row'. This creates a new horizontal group for the nested columns to align properly.
🧠 Conceptual
advanced1:30remaining
Why should you avoid placing a 'container' class inside a Bootstrap column?
What is the main reason to avoid placing a div with class 'container' inside a Bootstrap column when nesting rows and columns?
Attempts:
2 left
💡 Hint
Think about how 'container' affects width and spacing.
✗ Incorrect
The 'container' class adds fixed max-width and horizontal padding which can break the alignment and spacing of nested columns inside a parent column. Instead, use 'row' to nest columns properly without changing container width.
📝 Syntax
advanced2:00remaining
Identify the syntax error in this nested Bootstrap grid code
What is wrong with the following Bootstrap HTML code snippet?
<div class="row">
<div class="col-8">
<div class="col-6 bg-info p-2">Nested Column</div>
<div class="col-6 bg-secondary p-2">Nested Column</div>
</div>
<div class="col-4 bg-dark text-white p-2">Side Column</div>
</div>Bootsrap
<div class="row"> <div class="col-8"> <div class="row"> <div class="col-6 bg-info p-2">Nested Column</div> <div class="col-6 bg-secondary p-2">Nested Column</div> </div> </div> <div class="col-4 bg-dark text-white p-2">Side Column</div> </div>
Attempts:
2 left
💡 Hint
Nested columns must be inside a 'row' to align properly.
✗ Incorrect
In Bootstrap, columns must be direct children of a 'row'. Here, the nested 'col-6' divs are inside a 'col-8' without a 'row' wrapper, which breaks the grid layout and causes layout issues.
❓ accessibility
expert2:30remaining
How to improve accessibility in nested Bootstrap grid layouts?
You have a complex nested grid layout using Bootstrap rows and columns. Which practice best improves accessibility for screen reader users navigating this layout?
Attempts:
2 left
💡 Hint
Think about how screen readers understand page structure.
✗ Incorrect
Using semantic HTML5 elements with ARIA landmarks helps screen readers understand the page structure and navigate nested content better. Avoid hiding content or removing keyboard focus unnecessarily.