Advertisement

Google Ad Slot: content-top

Bootstrap 5 Float

~1 min read · Bootstrap
On this page

Bootstrap 5 provides utility classes for floating elements to align them to the left or right. These classes are responsive, allowing float behaviors to change across different screen sizes.


Syntax:

float-{size?}-{type}
  • float: Indicates display.
  • size (optional): Responsive breakpoint (e.g., sm : ≥576pxmd : ≥ 768pxlg : ≥992pxxl : ≥1200pxxxl : ≥1400px).
  • type : Defines the display type (e.g., startendnone).

Example:

  • .float-start
  • .float-sm-start
  • .float-md-start
  • .float-lg-start
  • .float-xl-start
  • .float-xxl-start

Class

Description

float-start

Floats the element to the left

float-end

Floats the element to the right

float-none

Removes float alignment

Example
Floated Left
Floated Right
No Float
Try it yourself