0
0
Bootsrapmarkup~20 mins

Gutters and spacing control in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Gutters and Spacing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Bootstrap Gutters
In Bootstrap, what does the g-3 class do when applied to a .row element?
AIt adds a 3rem (48px) margin outside the row.
BIt removes all gutters between columns.
CIt sets horizontal and vertical gutters to 1.5rem (24px) between columns.
DIt sets horizontal and vertical gutters to 1rem (16px) between columns.
Attempts:
2 left
💡 Hint
Remember, gutter classes like g-* control spacing inside rows between columns.
📝 Syntax
intermediate
2:00remaining
Correct Use of Spacing Utility Classes
Which option correctly adds a top margin of 3 (1rem) and horizontal padding of 4 (1.5rem) to a Bootstrap element?
Aclass="mt-3 px-4"
Bclass="mt-4 px-3"
Cclass="mb-3 pl-4"
Dclass="pt-3 mx-4"
Attempts:
2 left
💡 Hint
Top margin uses mt-*, horizontal padding uses px-*.
layout
advanced
2:00remaining
Effect of Removing Gutters in a Grid
Given this Bootstrap grid code, what will be the visual effect of adding g-0 to the .row?
Bootsrap
<div class="row g-0">
  <div class="col-6 bg-primary text-white">Left</div>
  <div class="col-6 bg-secondary text-white">Right</div>
</div>
AThe columns will have extra large gutters of 3rem between them.
BThe columns will have default gutters of 1.5rem between them.
CThe two columns will have no space between them, touching each other directly.
DThe columns will stack vertically instead of side by side.
Attempts:
2 left
💡 Hint
The g-0 class removes all gutters inside the row.
accessibility
advanced
2:00remaining
Spacing and Accessibility Considerations
Why is it important to maintain consistent gutters and spacing in a Bootstrap layout for accessibility?
ARemoving gutters improves keyboard navigation by reducing tab stops.
BConsistent spacing helps users with cognitive disabilities understand content grouping and improves readability.
CSpacing only affects visual style and has no impact on accessibility.
DLarge gutters confuse screen readers and should be avoided.
Attempts:
2 left
💡 Hint
Think about how spacing helps organize content visually and logically.
selector
expert
3:00remaining
Targeting Bootstrap Gutters with CSS
You want to override Bootstrap's horizontal gutter spacing only on medium screens and larger. Which CSS selector and property correctly targets the horizontal padding inside columns for .row with g-3?
A@media (min-width: 768px) { .row.g-3 > [class*='col-'] { padding-left: 0.5rem; padding-right: 0.5rem; } }
B@media (min-width: 768px) { .row.g-3 > [class^='col'] { margin-left: 0.5rem; margin-right: 0.5rem; } }
C@media (min-width: 768px) { .row.g-3 > [class*='col-'] { padding-left: 1.5rem; padding-right: 1.5rem; } }
D@media (max-width: 768px) { .row.g-3 > [class*='col-'] { padding-left: 0; padding-right: 0; } }
Attempts:
2 left
💡 Hint
Bootstrap columns use padding for gutters, and medium breakpoint starts at 768px.