Floats
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.
Floats: Left
Preview
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.
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 | * |
| Modifier | True |
| Selector | .slds-float_none |
|---|---|
| Summary | Removes float from an element that has attribute already |
| Restrict | * |
| Modifier | True |
| Selector | .slds-float_right |
|---|---|
| Summary | Pulls element from document flow and floats right. Text and other elements wrap around it. |
| Restrict | * |
| Modifier | True |