This works for modern browsers. If you want to support IE6 you will want to add the following:

.clearfix {
overflow: auto;
zoom: 1;
test
test
test
}

If we do not provide this hack then nested elements will overflow the container and not update the parent element.

About Gary Hicks

Gary Hicks is a professional website and graphics designer with more than 14 years experience. Having worked in London, Mexico City and Tokyo, Japan Gary is now based in Bournemouth and Windsor where he concentrates on work and staying fit.

Leave a Reply

Your email address will not be published.