Float
Float utilities move an element to the start or end of its container so text wraps around it, at any breakpoint (float-md-end) or not at all (float-none). Wrap floats in a clearfix parent so the container keeps its height. For layouts, prefer flex; floats shine for images in articles.
1Float start and end
float-start and float-end move an element to a side; clearfix on the parent contains them.
float-startfloat-end<div class="clearfix bg-body-tertiary rounded-3 p-2">
<div class="bg-primary-subtle border border-primary-subtle rounded-2 p-2 text-center float-start">
<code class="small">float-start</code>
</div>
<div class="bg-primary-subtle border border-primary-subtle rounded-2 p-2 text-center float-end">
<code class="small">float-end</code>
</div>
</div>2Text wrapping an image
A floated image with a margin lets the paragraph flow around it.
A school kit costs less than a cinema ticket and lasts a whole year. Local partners know their communities and make sure help arrives where it matters. We have helped more than two hundred thousand people since we started.
We keep things simple, so you can focus on what matters to you. Thousands of donors already trust us, and we work hard to keep it that way. Our annual report is independently audited and published in full.
<div class="clearfix">
<img src="https://images.unsplash.com/photo-1758599668360-48ba8ba71b47?auto=format&fit=crop&w=800&h=800&q=70" alt="Inside the shelter: from rescue to new home" width="140" class="float-start rounded-3 me-3 mb-2">
<p class="mb-2">A school kit costs less than a cinema ticket and lasts a whole year. Local partners know their communities and make sure help arrives where it matters. We have helped more than two hundred thousand people since we started.</p>
<p class="mb-0">We keep things simple, so you can focus on what matters to you. Thousands of donors already trust us, and we work hard to keep it that way. Our annual report is independently audited and published in full.</p>
</div>3Image on the right
float-end with ms-3 puts the figure on the right of the text.
Clean water wells are built with and maintained by local communities. You receive photos and updates showing exactly what your donation achieved. We listen first, then build a plan around what you actually need. Leave a gift in your will and help future generations. Thousands of donors already trust us, and we work hard to keep it that way.
<div class="clearfix">
<figure class="float-end ms-3 mb-2 text-center" style="width:150px">
<img src="https://images.unsplash.com/photo-1758599668356-c8c919e24dda?auto=format&fit=crop&w=1200&h=800&q=70" alt="A beginner's guide to getting started" class="w-100 rounded-3">
<figcaption class="small text-body-secondary mt-1">Denver</figcaption>
</figure>
<p class="mb-0">Clean water wells are built with and maintained by local communities. You receive photos and updates showing exactly what your donation achieved. We listen first, then build a plan around what you actually need. Leave a gift in your will and help future generations. Thousands of donors already trust us, and we work hard to keep it that way.</p>
</div>4Responsive float
float-md-end floats only from md; on phones the box stays in the normal flow.
Local partners know their communities and make sure help arrives where it matters. Start in minutes and get help from a real person whenever you need it. Clear prices, honest advice and no surprises along the way.
<div class="clearfix border rounded-3 p-3">
<div class="float-md-end ms-md-3 mb-2 bg-warning-subtle text-warning-emphasis rounded-3 p-2 small">
float-md-end
</div>
<p class="mb-0 small">Local partners know their communities and make sure help arrives where it matters. Start in minutes and get help from a real person whenever you need it. Clear prices, honest advice and no surprises along the way.</p>
</div>5float-none
float-none cancels a float, for example float-end float-sm-none.
float-end float-sm-none<div class="clearfix bg-body-tertiary rounded-3 p-2">
<div class="bg-primary-subtle border border-primary-subtle rounded-2 p-2 text-center float-end float-sm-none">
<code class="small">float-end float-sm-none</code>
</div>
</div>6Drop cap
A large floated first letter starts a story.
CWe listen first, then build a plan around what you actually need. Ninety cents of every dollar goes directly to the projects you support. Volunteers give their time in schools, shelters and food banks every week. Companies can match employee donations and double their impact.
<p class="mb-0"><span class="float-start display-4 fw-bold lh-1 me-2 text-primary">C</span>We listen first, then build a plan around what you actually need. Ninety cents of every dollar goes directly to the projects you support. Volunteers give their time in schools, shelters and food banks every week. Companies can match employee donations and double their impact.</p>7Pull quote
A floated quote with a side border inside an article.
Your kindness travels further than you think
We keep things simple, so you can focus on what matters to you. Every donation is tax-deductible, and receipts arrive by email instantly. Our team has done this many times, so you never have to guess. Friendly people answer your questions quickly, by phone, chat or email. We measure success by how many donors come back and tell their friends.
<div class="clearfix">
<blockquote class="float-end ms-3 mb-2 border-start border-4 border-primary ps-3 fs-5 fst-italic" style="max-width:14rem">Your kindness travels further than you think</blockquote>
<p class="mb-0 small">We keep things simple, so you can focus on what matters to you. Every donation is tax-deductible, and receipts arrive by email instantly. Our team has done this many times, so you never have to guess. Friendly people answer your questions quickly, by phone, chat or email. We measure success by how many donors come back and tell their friends.</p>
</div>8Floated buttons in a header
A heading with a float-end button; clearfix keeps the border below both.
Animals
<div class="clearfix border-bottom pb-2">
<button type="button" class="btn btn-sm btn-primary float-end"><i class="bi bi-plus-lg" aria-hidden="true"></i> New</button>
<h3 class="h5 mb-0">Animals</h3>
</div>9Avatar floated in a comment
A small floated avatar beside comment text.
We have helped more than two hundred thousand people since we started. Monthly gifts let us plan ahead and respond quickly when disaster strikes.
<div class="clearfix border rounded-3 p-3">
<img src="../assets/img/avatar-11.svg" alt="Luna Sato" width="44" height="44" class="rounded-circle float-start me-3">
<div class="fw-semibold">
Luna Sato
</div>
<p class="small mb-0">We have helped more than two hundred thousand people since we started. Monthly gifts let us plan ahead and respond quickly when disaster strikes.</p>
</div>10Price floated right
Menu rows with the price floated to the end.
- $26.43Vet care
- $21.61Shelter support
- $22.89Emergency fund
<ul class="list-unstyled mb-0" style="max-width:24rem">
<li class="clearfix border-bottom py-2"><span class="float-end fw-semibold">$26.43</span>Vet care</li>
<li class="clearfix border-bottom py-2"><span class="float-end fw-semibold">$21.61</span>Shelter support</li>
<li class="clearfix py-2"><span class="float-end fw-semibold">$22.89</span>Emergency fund</li>
</ul>11Without clearfix
Without clearfix the parent collapses; with it the background wraps the floats.
floatfloat<div class="row g-2">
<div class="col-sm-6">
<div class="bg-danger-subtle rounded-3 p-1 small">
no clearfix
<div class="bg-primary-subtle border border-primary-subtle rounded-2 p-2 text-center float-end">
<code class="small">float</code>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="clearfix bg-success-subtle rounded-3 p-1 small">
clearfix
<div class="bg-primary-subtle border border-primary-subtle rounded-2 p-2 text-center float-end">
<code class="small">float</code>
</div>
</div>
</div>
</div>12Floated icon in a note
A big icon floated to the start of a note.
You receive photos and updates showing exactly what your donation achieved. Our annual report is independently audited and published in full.
<div class="clearfix bg-info-subtle text-info-emphasis rounded-3 p-3">
<span class="float-start fs-2 lh-1 me-3"><i class="bi bi-info-circle" aria-hidden="true"></i></span>
<p class="small mb-0">You receive photos and updates showing exactly what your donation achieved. Our annual report is independently audited and published in full.</p>
</div>13Gallery of floated tiles
Floated tiles with margins form a simple wrapping gallery.
<div class="clearfix">
<img src="https://images.unsplash.com/photo-1758599668178-d9716bbda9d5?auto=format&fit=crop&w=800&h=800&q=70" alt="Gallery 1" width="90" height="90" class="float-start me-2 mb-2 rounded-3 object-fit-cover"> <img src="https://images.unsplash.com/photo-1758599668356-c8c919e24dda?auto=format&fit=crop&w=800&h=800&q=70" alt="Gallery 2" width="90" height="90" class="float-start me-2 mb-2 rounded-3 object-fit-cover"> <img src="https://images.unsplash.com/photo-1557660559-42497f78035b?auto=format&fit=crop&w=800&h=800&q=70" alt="Gallery 3" width="90" height="90" class="float-start me-2 mb-2 rounded-3 object-fit-cover"> <img src="https://images.unsplash.com/photo-1560220604-1985ebfe28b1?auto=format&fit=crop&w=800&h=800&q=70" alt="Gallery 4" width="90" height="90" class="float-start me-2 mb-2 rounded-3 object-fit-cover">
</div>14Signature block
float-end with text-end places a signature at the bottom right of a letter.
Every detail is handled by people who care about getting it right. Clean water wells are built with and maintained by local communities.
<div class="clearfix border rounded-3 p-3">
<p class="small">Every detail is handled by people who care about getting it right. Clean water wells are built with and maintained by local communities.</p>
<div class="float-end text-end">
<div class="fst-italic">
Hana Patel
</div>
<div class="small text-body-secondary">
Support Specialist
</div>
</div>
</div>15Sidebar box floated
A fact box floated to the end of an article on md and up.
A school kit costs less than a cinema ticket and lasts a whole year. Ninety cents of every dollar goes directly to the projects you support. Thousands of donors already trust us, and we work hard to keep it that way. Clear prices, honest advice and no surprises along the way. You receive photos and updates showing exactly what your donation achieved.
<div class="clearfix">
<aside class="float-md-end ms-md-3 mb-3 border rounded-3 p-3 bg-body-tertiary small" style="max-width:14rem">
<div class="fw-semibold mb-1">
Quick facts
</div>
<div>
Founded 2006
</div>
<div>
Barcelona
</div>
<div>
355 staff
</div>
</aside>
<p class="mb-0">A school kit costs less than a cinema ticket and lasts a whole year. Ninety cents of every dollar goes directly to the projects you support. Thousands of donors already trust us, and we work hard to keep it that way. Clear prices, honest advice and no surprises along the way. You receive photos and updates showing exactly what your donation achieved.</p>
</div>16Badge floated on a title
A small badge floated to the end of a card title.
<div class="border rounded-3 p-3" style="max-width:22rem">
<span class="badge text-bg-success float-end">In review</span>
<div class="fw-semibold">
Food relief
</div>
<div class="small text-body-secondary">
Mar 1, 2026
</div>
</div>17Two floated columns
Two w-50 boxes, one float-start and one float-end, fill a row.
float-start w-50float-end w-50<div class="clearfix">
<div class="float-start w-50 pe-1">
<div class="bg-primary-subtle border border-primary-subtle rounded-2 p-2 text-center">
<code class="small">float-start w-50</code>
</div>
</div>
<div class="float-end w-50 ps-1">
<div class="bg-primary-subtle border border-primary-subtle rounded-2 p-2 text-center">
<code class="small">float-end w-50</code>
</div>
</div>
</div>18Floated close icon
A dismiss icon floated to the end of a message box.
<div class="border rounded-3 p-3 bg-body-tertiary">
<button type="button" class="btn-close float-end" aria-label="Close"></button>
<div class="fw-semibold">
Hope starts with you
</div>
<div class="small">
We measure success by how many donors come back and tell their friends.
</div>
</div>19Step number floated
A circle number floated beside each instruction.
- 1Our team has done this many times, so you never have to guess.
- 2Friendly people answer your questions quickly, by phone, chat or email.
- 3Companies can match employee donations and double their impact.
<ol class="list-unstyled mb-0 d-grid gap-2">
<li class="clearfix"><span class="float-start me-2 text-bg-primary rounded-circle text-center small fw-bold" style="width:26px;height:26px;line-height:26px">1</span>Our team has done this many times, so you never have to guess.</li>
<li class="clearfix"><span class="float-start me-2 text-bg-primary rounded-circle text-center small fw-bold" style="width:26px;height:26px;line-height:26px">2</span>Friendly people answer your questions quickly, by phone, chat or email.</li>
<li class="clearfix"><span class="float-start me-2 text-bg-primary rounded-circle text-center small fw-bold" style="width:26px;height:26px;line-height:26px">3</span>Companies can match employee donations and double their impact.</li>
</ol>20Floats per breakpoint
float-sm-start, float-md-end and float-lg-none switch side as the screen grows.
sm start, md end, lg none<div class="clearfix bg-body-tertiary rounded-3 p-2">
<div class="bg-primary-subtle border border-primary-subtle rounded-2 p-2 text-center float-sm-start float-md-end float-lg-none">
<code class="small">sm start, md end, lg none</code>
</div>
</div>