May 18
Clearing floats
1 comments 2004 at 02.33 am posted by Veerle
A few weeks ago I posted an article about the collapsing effect you get when a float is contained within a container box that has a visible background and how you can solve this problem. It seems that there is a smatter solution that involves no extra code in the HTML to solve this.
I’ve found an interesting article on how to clear floats without structural markup. This page explains why this effect happens and how to solve it in both the “old-fashion” way (using “clear:both” and 1 line of HTML code) or the smarter way (no HTML code needed) using the :after CSS 2 property.