Click to See Complete Forum and Search --> : IE6 and clearing float space


nnhubbard
06-17-2008, 02:36 PM
I have a div that clears floats throughout my site using:

.clear:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}
.clear {clear:both; height: 0; visibility:hidden; font-size:1px; display:block;}
* html .clear {height: 1%;}

For some reason, IE6 does not like this, and add padding or some height to do div. For the life of me, I can't figure out how to remove the height of the clearing div in IE6. It is adding large spaces below my floats, and messing up my design.

Any ideas?

Centauri
06-17-2008, 06:36 PM
The 1% height would be doing this. This code seems to be a mixture of the (in my opinion, silly) common "clearfix" class, which is normally implemneted differently to what it seems you are using. If this class is being applied to an additional div you are placing below floats, then all you need is :.clear {clear:both; height: 0; overflow:hidden; font-size:1px;}