float property can also be used to float multiple elements at once. When multiple floated elements have different heights, however, this can affect their layout on the page. Specifically, elements can "bump" into each other and not allow other elements to properly move the left or or the right.
clear property specifies how elements should behave when they bump into each other on the page. It can take on one of the following values:
left — the left side of the element will not touch any other element within the same containing element.
right — the right side of the element will not touch any other element within the same containing element.
both — neither side of the element will touch any other element within the same containing element.
none — the element can touch either side.
In the example above, all divs on the page are floated to the left side. The div with class
special did not move all the way to the left because a taller div blocked its positioning. By setting its
clear property to
special div will be moved all the way to the left side of the page.