Clearfix
Bootstrap 5 Clearfix
Quickly and easily clear floated content within a container by adding a clearfix utility.
Basic example
Easily clear float
s by adding .clearfix
to the parent element. Can also be used as a mixin.
Use in HTML:
This is a mobile version of the documentation.
View this website on the desktop to copy & edit the source code of the component.
The mixin source code:
This is a mobile version of the documentation.
View this website on the desktop to copy & edit the source code of the component.
Use the mixin in SCSS:
This is a mobile version of the documentation.
View this website on the desktop to copy & edit the source code of the component.
The following example shows how the clearfix can be used. Without the clearfix the wrapping div would not span around the buttons which would cause a broken layout.
This is a mobile version of the documentation.
View this website on the desktop to copy & edit the source code of the component.