The CSS clearfix has been a must-have in our web design toolkit for quite some time, and until new layout features like flexbox become more stable, we’ll always need some form of clearfix in float based layouts. There are several ways we can clear floats with plain CSS, but each requires repeating either a class in the markup or the same properties and values throughout the CSS.
view source