What is the best way to clear the CSS style "float"?

Posted by Sam Saffron on Stack Overflow See other posts from Stack Overflow or by Sam Saffron
Published on 2009-01-29T01:32:20Z Indexed on 2010/05/12 15:14 UTC
Read the original article Hit count: 231

Filed under:
|

I'm pretty accustomed to clearing my floats by using <br style="clear:both"/> but stuff keeps on changing and I am not sure if this is the best practice.

There is a CSS hack (from positioneverything) available that lets you achieve the same result without the clearing div. But... they claim the hack is a little out of date and instead you perhaps should look at this hack. But.. after reading through 700 pages of comments :) it seems there may be some places the latter hack does not work.

I would like to avoid any javascript hacks cause I would like my clearing to work regardless of javascript being enabled.

What is the current best practice for clearing divs in a browser independent way?

© Stack Overflow or respective owner

Related posts about css

Related posts about css-layout