The other answers are correct. But I want to add that it is a relic of the time when people were first learning CSS, and abused float
to do all their layout. float
is meant to do stuff like float images next to long runs of text, but lots of people used it as their primary layout mechanism. Since it wasn't really meant for that, you need hacks like "clearfix" to make it work.
These days display: inline-block
is a solid alternative (except for IE6 and IE7), although more modern browsers are coming with even more useful layout mechanisms under names like flexbox, grid layout, etc.