I saw this rather different method for clearfix here: http://www.marcwatts.com.au/blog/best-clearfix-ever/
It proposes adding the following CSS code which automates clea
I've been clearing all divs globally for the past couple of years in my projects, and it has been working great for me. In approximately 95% of the cases where I use divs, clearfix
has worked like a charm when applied to a site globally. There are certainly cases where a potential issue will arise, and I end up undoing the clearfix
for any problematic divs. The CSS declarations I use are:
div:after {
clear: both;
margin: 0;
padding: 0;
display: table;
font-size: 0;
line-height: 0;
content: ' ';
visibility: hidden;
overflow: hidden;
}
div {
*zoom: 1;
}