It's worth noting that today, the use of floated elements for layout is getting more and more discouraged with the use of better alternatives.
display: inline-block - Better
Flexbox - Best (but limited browser support)
Flexbox is supported from Firefox 18, Chrome 21, Opera 12.10, and Internet Explorer 10, Safari 6.1 (including Mobile Safari) and Android's default browser 4.4.
For a detailed browser list see: http://caniuse.com/flexbox.
(Perhaps once it's position is established completely, it may be the absolutely recommended way of laying out elements.)
A clearfix is a way for an element to automatically clear after itself, so that you don't need to add additional markup. It's generally used in float layouts where elements are floated to be stacked horizontally.
The clearfix is a way to combat the zero-height container problem for floated elements
A clearfix is performed as follows:
content: " "; /* Older browser do not support empty content */
Or, if you don't require IE<8 support, the following is fine too:
Normally you would need to do something as follows:
<div style="float: left;">Sidebar</div>
<div style="clear: both;"></div> <!-- Clear the float -->