Home › Forums › CSS › Clearfix to much?? › Re: Clearfix to much??
February 11, 2013 at 5:44 pm
#124117
tomrogers123
Member
I think really it depends which version you mean. I would say that the one with support for old versions of IE is a little overkill but that rather gets into the debate of supporting IE in general. The most progressive method simply consists of:
.element-with-floated-objects:after {
content: “”;
display: block;
clear: both;
}
As this uses a pseudo class selector, some more weird stuff is needed for IE7 and down:
* html .clearfix { height: 1%; }
.element-with-floated-objects { display: block; }
In my opinion, this is fine – especially the more modern one – as other methods (like setting `overflow:hidden ` on the container) can have annoying knock-on effects.