Vertical Align
Vertical align utilities set vertical-align on inline, inline-block and table-cell elements: align-baseline, align-top, align-middle, align-bottom, align-text-top and align-text-bottom. Use them for icons beside text and for table cells; for block layouts use flex alignment instead.
1Inline alignment values
align-baseline, -top, -middle, -bottom, -text-top and -text-bottom on inline elements next to large text.
Ag baseline top middle bottom text-top text-bottom
<p class="fs-2 mb-0 bg-body-tertiary rounded-3 p-2">Ag <span class="align-baseline fs-6 bg-primary-subtle px-1">baseline</span> <span class="align-top fs-6 bg-primary-subtle px-1">top</span> <span class="align-middle fs-6 bg-primary-subtle px-1">middle</span> <span class="align-bottom fs-6 bg-primary-subtle px-1">bottom</span> <span class="align-text-top fs-6 bg-success-subtle px-1">text-top</span> <span class="align-text-bottom fs-6 bg-success-subtle px-1">text-bottom</span> </p>2Table cell alignment
align-top, align-middle and align-bottom on cells of a tall table row.
| align-top | align-middle | align-bottom |
<table class="table table-bordered small mb-0">
<tbody>
<tr style="height:110px">
<td class="align-top">align-top</td>
<td class="align-middle">align-middle</td>
<td class="align-bottom">align-bottom</td>
</tr>
</tbody>
</table>3Middle align a whole table
align-middle on the table aligns every cell, useful with avatars and buttons.
| Freya Alvarez | ||
| Mia Delgado |
<div class="table-responsive">
<table class="table align-middle mb-0 small">
<tbody>
<tr>
<td><img src="../assets/img/avatar-1.svg" alt="" width="40" height="40" class="rounded-circle"></td>
<td>Freya Alvarez</td>
<td><button type="button" class="btn btn-sm btn-outline-primary">Message</button></td>
</tr>
<tr>
<td><img src="../assets/img/avatar-2.svg" alt="" width="40" height="40" class="rounded-circle"></td>
<td>Mia Delgado</td>
<td><button type="button" class="btn btn-sm btn-outline-primary">Message</button></td>
</tr>
</tbody>
</table>
</div>4Icon next to text
align-middle lines an icon up with the middle of the text.
The new insurance friendly shows new ideas to life all year round.
<p class="mb-0"><span class="fs-4 align-middle text-primary"><i class="bi bi-info-circle-fill" aria-hidden="true"></i></span> <span class="align-middle">The new insurance friendly shows new ideas to life all year round.</span></p>5Inline image in a sentence
align-text-bottom keeps a small avatar on the text line.
Written by Maya Ortega on Jul 17, 2026.
<p class="mb-0">Written by <img src="../assets/img/avatar-2.svg" alt="" width="22" height="22" class="rounded-circle align-text-bottom"> <strong>Maya Ortega</strong> on Jul 17, 2026.</p>6Badge beside a heading
A badge with align-middle beside a heading.
How we rebuilt our project New
<h3 class="h4 mb-0">How we rebuilt our project <span class="badge text-bg-primary fs-6 align-middle">New</span></h3>7Superscript price
align-top on the currency sign and align-baseline on the cents.
<div class="fw-bold">
<span class="fs-5 align-top">$</span><span class="display-5">99</span><span class="fs-5 align-baseline">.91</span><span class="small text-body-secondary fw-normal"> / mo</span>
</div>8Checkbox label alignment
Inline checkboxes and labels with align-middle in a sentence.
<p class="mb-0"><input class="form-check-input align-middle" type="checkbox" id="ut-copy-1261" checked> <label class="align-middle" for="ut-copy-1261">Send me a copy of Inside the fast release</label></p>9Inline-block boxes
d-inline-block boxes of different heights aligned top, middle and bottom.
<div class="bg-body-tertiary rounded-3 p-2">
<span class="d-inline-block bg-primary-subtle rounded-2 p-2 align-top" style="height:80px">top</span> <span class="d-inline-block bg-primary-subtle rounded-2 p-2 align-middle">middle</span> <span class="d-inline-block bg-primary-subtle rounded-2 p-2 align-bottom">bottom</span> <span class="d-inline-block bg-success-subtle rounded-2 p-2 align-middle" style="height:50px">middle 50px</span>
</div>10Price table with bottom aligned totals
align-bottom keeps totals on the last line of tall cells.
| Item | Total |
|---|---|
| Video consult Dental Qty 4 | $185.33 |
<table class="table table-sm small mb-0">
<thead>
<tr>
<th scope="col">Item</th>
<th scope="col" class="text-end">Total</th>
</tr>
</thead>
<tbody>
<tr>
<td>Video consult<br><span class="text-body-secondary">Dental</span><br><span class="text-body-secondary">Qty 4</span></td>
<td class="align-bottom text-end fw-semibold">$185.33</td>
</tr>
</tbody>
</table>11Status dots in text
Small dots with align-middle next to status words.
- API operational
- Dashboard degraded
- Webhooks down
<ul class="list-unstyled mb-0 small d-grid gap-1">
<li><span class="d-inline-block bg-success rounded-circle align-middle me-1" style="width:8px;height:8px"></span><span class="align-middle">API operational</span></li>
<li><span class="d-inline-block bg-warning rounded-circle align-middle me-1" style="width:8px;height:8px"></span><span class="align-middle">Dashboard degraded</span></li>
<li><span class="d-inline-block bg-danger rounded-circle align-middle me-1" style="width:8px;height:8px"></span><span class="align-middle">Webhooks down</span></li>
</ul>12Keyboard shortcut
kbd keys with align-text-top in a help line.
Press Ctrl + K to search Brand name 1.
<p class="mb-0 small">Press <kbd class="align-text-top">Ctrl</kbd> + <kbd class="align-text-top">K</kbd> to search Brand name 1.</p>13Mixed sizes on a line
align-baseline keeps different font sizes sitting on one line.
843 orders +10 today
<p class="mb-0"><span class="fs-1 fw-bold align-baseline">843</span> <span class="fs-5 align-baseline">orders</span> <span class="small text-success align-baseline">+10 today</span></p>14Thumbnail with caption beside
Inline image and text aligned to the top with align-top.
Our lab tests gives results you can measure for teams of every size.
<div>
<img src="../assets/img/product-8.svg" alt="Blood test" width="64" height="64" class="rounded-2 align-top me-2 object-fit-cover"><span class="d-inline-block align-top small" style="max-width:14rem"><strong>Blood test</strong><br>Our lab tests gives results you can measure for teams of every size.</span>
</div>15Buttons and text in one line
align-middle on a small button inside a paragraph.
7 items selected
<p class="mb-0">7 items selected <button type="button" class="btn btn-sm btn-outline-danger align-middle ms-2">Clear</button></p>16Footnote marker
align-text-top raises a small reference number.
This friendly workflow turns results you can measure without extra tools.[1]
<p class="mb-0">This friendly workflow turns results you can measure without extra tools.<a href="#" class="small align-text-top text-decoration-none">[1]</a></p>17Rating with value
Stars and score aligned middle in one line.
4.8 (720 reviews)
<p class="mb-0"><span class="text-warning align-middle"><i class="bi bi-star-fill" aria-hidden="true"></i><i class="bi bi-star-fill" aria-hidden="true"></i><i class="bi bi-star-fill" aria-hidden="true"></i><i class="bi bi-star-fill" aria-hidden="true"></i><i class="bi bi-star-half" aria-hidden="true"></i></span> <span class="fw-semibold align-middle">4.8</span> <span class="small text-body-secondary align-middle">(720 reviews)</span></p>18Table header bottom aligned
align-bottom on header cells with wrapped titles.
| Name | Monthly active users | Plan |
|---|---|---|
| Brand name 1 | 17.5k | Pro |
<table class="table table-sm small mb-0">
<thead>
<tr>
<th scope="col" class="align-bottom">Name</th>
<th scope="col" class="align-bottom">Monthly<br>active<br>users</th>
<th scope="col" class="align-bottom">Plan</th>
</tr>
</thead>
<tbody>
<tr>
<td>Brand name 1</td>
<td>17.5k</td>
<td>Pro</td>
</tr>
</tbody>
</table>19Flag and country
A small logo image with align-middle beside a country name.
South Korea
<p class="mb-0"><img src="../assets/img/logo-5.svg" alt="" width="36" height="12" class="align-middle rounded-1 border object-fit-cover"> <span class="align-middle">South Korea</span></p>20Toggle row
A switch and its label aligned with align-middle in an inline row.
<div class="form-check form-switch d-inline-block align-middle mb-0">
<input class="form-check-input" type="checkbox" role="switch" id="ut-dark-1262">
<label class="form-check-label" for="ut-dark-1262">Dark mode</label>
</div>
<span class="badge text-bg-secondary align-middle ms-2">Beta</span>