The most popular way of clearing a group of floats is to use clear:both;
on the parent's :after
pseudo-element. For example this:
.group:after {
visibility: hidden;
display: block;
content: "";
clear: both;
height: 0;
}
* html .group { zoom: 1; } /* IE6 */
*:first-child+html .group { zoom: 1; } /* IE7 */
This works fine in most cases, but it fails when you have floated elements within floated elements. It clears all floats, not just the child floats.
A possible way of fixing that is by adding
.group {
display:inline-block;
}
But this can have unwanted side-effects.
Is there any way of clearing only child floats, instead of every float on a page?