I have three floating div-containers but the clear-fix-solutions I found on other websites don't work. I think I am doing something wrong but don't know what.
How do I write a correct clearfix
?
Here is a fiddle:
http://jsfiddle.net/h23A5/
HTML:
<div class="box"></div>
<div class="box"></div>
<div class="box nomargin clearfix"></div>
And CSS:
.clearfix:after {
visibility: hidden;
display: block;
content: "";
clear: both;
height: 0;
}
* html .clearfix { zoom: 1; } /* IE6 */
*:first-child+html .clearfix { zoom: 1; } /* IE7 */