Bootstrap 6 · Subject Guide
Layout & Responsive Grid
Breakpoints, columns, row-cols, wrapping, alignment, and gutters.
Version note: Bootstrap 6 is alpha. These guides use the 6.0.0-alpha.1 CDN. Some class names from your notes may require a custom build or project CSS.
1. Breakpoints
Use responsive column classes to change layout at viewport widths. This guide follows the breakpoint prefixes supplied in your notes.
| Breakpoint | Class infix | Width | Typical device |
|---|---|---|---|
| Extra small | col- | <576px | Portrait phones |
| Small | sm:col- | ≥576px | Landscape phones |
| Medium | md:col- | ≥768px | Tablets |
| Large | lg:col- | ≥1024px | Desktops |
| Extra large | xl:col- | ≥1280px | Large desktops |
| Extra extra large | 2xl:col- | ≥1536px | Very large desktops |
Ready-to-use code
<div class="row">
<div class="col-12 md:col-6 xl:col-4">Card 1</div>
<div class="col-12 md:col-6 xl:col-4">Card 2</div>
<div class="col-12 md:col-6 xl:col-4">Card 3</div>
</div>2. Equal, specific, and row columns
Use col for equal-width columns, col-6 for half-width columns, and row-cols-* to set how many columns appear in each row.
col
col
Ready-to-use code
<!-- Equal width -->
<div class="row"><div class="col">A</div><div class="col">B</div></div>
<!-- Specific width -->
<div class="row"><div class="col-6">Half</div><div class="col-6">Half</div></div>
<!-- Two columns per row -->
<div class="row row-cols-2"><div class="col">A</div><div class="col">B</div></div>
<!-- Responsive columns -->
<div class="row row-cols-1 sm:row-cols-2 md:row-cols-4">...</div>3. Wrapping and forced line break
Columns wrap automatically when the row becomes full. Add a full-width element when you need to force the next columns onto a new line.
Ready-to-use code
<div class="row">
<div class="col-6">First</div>
<div class="col-6">Second</div>
<div class="w-100"></div> <!-- force new line -->
<div class="col-6">Third</div>
<div class="col-6">Fourth</div>
</div>4. Vertical alignment
Align row children at the top, center, or bottom using the alignment utility.
StartTwo
lines
lines
CenterTwo
lines
lines
EndTwo
lines
lines
Ready-to-use code
<div class="row align-items-start">...</div>
<div class="row align-items-center">...</div>
<div class="row align-items-end">...</div>5. Gutters
Gutter width is typically 1.5rem overall (.75rem on each side). Use g-* for both axes, gx-* horizontally, and gy-* vertically.
Ready-to-use code
<div class="row g-3">...</div> <!-- horizontal + vertical -->
<div class="row gx-4">...</div> <!-- horizontal only -->
<div class="row gy-2">...</div> <!-- vertical only -->