Utilities

Floats

Use a float to pull an element out of the document’s normal flow and to align it with the left or right side of the container.

About Floats#

To float an element on the left, add the .slds-float_left class to the element. To float it on the right, add the .slds-float_right class.

Note

The floated element must be first in the document flow, even if it renders on the right.

If you want the parent of the floated element to contain the floats, add the .slds-clearfix class to the parent.

Examples#

Left#

I’m floooaaaating

<div class="slds-clearfix">
  <div class="slds-float_left">
    <p>I’m floooaaaating</p>
  </div>

I’m floooaaaating

<div class="slds-clearfix">
  <div class="slds-float_right">
    <p>I’m floooaaaating</p>
  </div>

None#

I’m not floooaaaating

<div class="slds-float_none">
  <p>I’m not floooaaaating</p>
</div>

Clearfix#

I’m floooaaaating

I’m floooaaaating

<div class="slds-clearfix">
  <div class="slds-float_left">
    <p>I’m floooaaaating</p>
  </div>

Overview of CSS Classes#

Selector.slds-float_left
Summary

Pulls element from document flow and floats left. Text and other elements wrap around it.

Restrict*
ModifierTrue
Selector.slds-float_none
Summary

Removes float from an element that has attribute already

Restrict*
ModifierTrue
Selector.slds-float_right
Summary

Pulls element from document flow and floats right. Text and other elements wrap around it.

Restrict*
ModifierTrue

Floats Utility Release Notes