How to "patch" clearfix so it can better handle collapsing margins

positioniseverything

Vertical margins do not collapse in IE (< 8), but in other browsers the top margin does.

.clearfix:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}
.clearfix { zoom: 1; } /* IE 5.5/6/7 */

perishablepress

Vertical margins do not collapse in IE (< 8), but in other browsers both margins collapse.

.clearfix:after {
  visibility: hidden;
  display: block;
  font-size: 0;
  content: " ";
  clear: both;
  height: 0;
}
.clearfix { zoom: 1; } /* IE 5.5/6/7 */

tjkdesign

Vertical margins do not collapse across browsers.

.clearfix:before, .clearfix:after {
  content: ".";    
  display: block;    
  height: 0;    
  overflow: hidden;    
}
.clearfix:after {clear: both;}
.clearfix {zoom: 1;} /* IE 5.5/6/7 */