Clear a floating element without additional markup
Posted by Marcel Scherf on July 4, 2008
2 comments
Found at: Position is everything
Normally you would add an element like this:
<div style=”clear:both”> </div>
after your floating elements to clear them. With this method you don’t need to do this anymore.
Just add this to your stylesheet:
.clearfix:after {
content: “.”;
display: block;
height: 0;
clear: both;
[...]