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.
| Luna Ibrahim | ||
| Finn 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>Luna Ibrahim</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>Finn 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.
Our team has done this many times, so you never have to guess.
<p class="mb-0"><span class="fs-4 align-middle text-primary"><i class="bi bi-info-circle" aria-hidden="true"></i></span> <span class="align-middle">Our team has done this many times, so you never have to guess.</span></p>5Inline image in a sentence
align-text-bottom keeps a small avatar on the text line.
Written by Hana Patel on Sep 12, 2025.
<p class="mb-0">Written by <img src="../assets/img/avatar-1.svg" alt="" width="22" height="22" class="rounded-circle align-text-bottom"> <strong>Hana Patel</strong> on Sep 12, 2025.</p>6Badge beside a heading
A badge with align-middle beside a heading.
Looking back at a busy season New
<h3 class="h4 mb-0">Looking back at a busy season <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">93</span><span class="fs-5 align-baseline">.90</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 Understanding your blood test results</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 |
|---|---|
| Annual check-up Orthopedics Qty 3 | $75.63 |
<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>Annual check-up<br><span class="text-body-secondary">Orthopedics</span><br><span class="text-body-secondary">Qty 3</span></td>
<td class="align-bottom text-end fw-semibold">$75.63</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 Brioo.
<p class="mb-0 small">Press <kbd class="align-text-top">Ctrl</kbd> + <kbd class="align-text-top">K</kbd> to search Brioo.</p>13Mixed sizes on a line
align-baseline keeps different font sizes sitting on one line.
423 orders +20 today
<p class="mb-0"><span class="fs-1 fw-bold align-baseline">423</span> <span class="fs-5 align-baseline">orders</span> <span class="small text-success align-baseline">+20 today</span></p>14Thumbnail with caption beside
Inline image and text aligned to the top with align-top.
Family plans cover check-ups and vaccinations for everyone under one roof.
<div>
<img src="../assets/img/product-7.svg" alt="Teeth whitening" 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>Teeth whitening</strong><br>Family plans cover check-ups and vaccinations for everyone under one roof.</span>
</div>15Buttons and text in one line
align-middle on a small button inside a paragraph.
8 items selected
<p class="mb-0">8 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.
We keep things simple, so you can focus on what matters to you.[1]
<p class="mb-0">We keep things simple, so you can focus on what matters to you.<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 (599 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">(599 reviews)</span></p>18Table header bottom aligned
align-bottom on header cells with wrapped titles.
| Name | Monthly active users | Plan |
|---|---|---|
| Brioo | 26.4k | Starter |
<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>Brioo</td>
<td>26.4k</td>
<td>Starter</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-2.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>