Float right
Bootstrap 5 Float right component
Responsive float right built with Bootstrap 5. Easily align elements to the right with intuitive, responsive float utilities for better web design.
Basic example
These utility classes float an element to the right, based on the
current viewport size using the
CSS
float
property. !important
is included to avoid specificity issues. These use the
same
viewport breakpoints as grid system. Note that float utilities have no effect on
flex items.
Use .float-end
to float an element to the right of its container.
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Minus reiciendis alias asperiores molestiae veniam nihil dolore quaerat libero voluptatibus, officia, ut ea deserunt itaque debitis assumenda, aliquid rerum officiis commodi? Nobis perspiciatis consequatur vero aut, placeat praesentium quam eveniet. A amet provident perferendis fugit, alias beatae unde qui velit dignissimos quidem architecto doloribus maiores quis ut. Eligendi, culpa, repudiandae sint quidem molestiae vero dolor cumque fugit aliquid ipsam voluptates distinctio. Corporis animi laborum nostrum labore similique ullam, optio quidem quae adipisci iste at molestiae, delectus voluptates deleniti sint molestias modi itaque deserunt officiis asperiores aliquam. Vitae nostrum autem animi assumenda!
<img src="https://mdbootstrap.com/img/new/textures/small/52.jpg" class="float-end">
<p class="">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Minus reiciendis alias
asperiores molestiae veniam
nihil dolore quaerat libero voluptatibus, officia, ut ea deserunt itaque debitis assumenda, aliquid
rerum officiis
commodi? Nobis perspiciatis consequatur vero aut, placeat praesentium quam eveniet. A amet provident
perferendis
fugit, alias beatae unde qui velit dignissimos quidem architecto doloribus maiores quis ut.
Eligendi, culpa,
repudiandae sint quidem molestiae vero dolor cumque fugit aliquid ipsam voluptates distinctio.
Corporis animi laborum
nostrum labore similique ullam, optio quidem quae adipisci iste at molestiae, delectus voluptates
deleniti sint
molestias modi itaque deserunt officiis asperiores aliquam. Vitae nostrum autem animi assumenda!</p>
Responsive
Responsive variations also exist for each float
value.
<div class="float-sm-end">Float left on viewports sized SM (small) or wider</div>
<br />
<div class="float-md-end">Float left on viewports sized MD (medium) or wider</div>
<br />
<div class="float-lg-end">Float left on viewports sized LG (large) or wider</div>
<br />
<div class="float-xl-end">Float left on viewports sized XL (extra-large) or wider</div>
<br />