Clearing Floats

Learn about the clear property of the CSS and how it's used to align elements smoothly.

The clear property

A CSS property that goes hand-in-hand with the float property is the clear property.

Without the clear property applied, the element that follows a floated element will be horizontally placed next to the floated element if there is enough horizontal space available for the next element to fit.

With the clear property applied to any element that follows the floated element, that element will be placed below the floated element, even though it would horizontally fit next to the floated element if the clear property were not applied.

Get hands-on with 1400+ tech skills courses.