This is a general question and something that dawned on me and seemed to make sense. I have seen many people use clearing divs and
Both methods are old fashioned. The latest "trick" is to use overflow
property for the container of float elements.
If for example you have:
text here
text here
with float
class float:left
then it's better to use overflow:hidden
or overflow:auto
than or the
hr
method.
Demo: http://jsfiddle.net/vALSL/
Read more here: http://www.quirksmode.org/css/clearing.html