Search⌘ K
AI Features

Clearing Floats

Understand how to apply the CSS clear property to manage elements that follow floated elements. This lesson teaches you how clearing floats works, why it matters in layouts, and how to use values like left, right, and both to ensure proper element positioning when using floats.

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 ...