Jan 28
I know I've read this article about 10 times over, and yet I always seem to keep forgetting about it. Everyone always suggests, "in order to keep a floated image from floating over its containing box, add a 1px DIV, or BR tag that uses a style of clear:both". This is what I always remember, simply because it's the most prevalent solution.

However, thanks to my CSS love in Paul O'Brien at SitePoint, there's a much, much simpler solution. Apply overflow:auto; to the containing element. That's all there is to it. I love that man! :-)

Source: http://www.sitepoint.com/blogs/2005/02/26/simple-clearing-of-floats/

P.S. - Depending on the layout, this may not always work, that's why I linked to the source (and, also to give credit where credit is due) - the comments contain even more help if it doesn't work in your layout.

Posted by Brendon Kozlowski

0 Trackbacks

  1. No Trackbacks

0 Comments

Display comments as(Linear | Threaded)
  1. No comments

Add Comment


Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

BBCode format allowed