03.31.08
How has this clean method of clearing floats not gotten any attention? For those that can't find it in the article, instead of using a clearing element (<div style="clear:both;"></div> or <br style="clear:both"/>), you simple add overflow:auto to the styles of the wrapper element. Nick and I were both a little skeptical, until we tried it on a layout we were working on. Seems to work. Anyone want to find me an instance where it doesn't?


Comments for "Short-310"
Sean
commented on Mar. 31st, 2008 at 9:27 pm
I can vouch for this, it has never really failed me.
overflow:hidden also works, sometimes one is better than the other in IE6 when you have an element larger than its container.
Monkey B
commented on Apr. 1st, 2008 at 4:33 am
"overflow:hidden also works, sometimes one is better than the other in IE6 when you have an element larger than its container."
Indeed, I always prefer "hidden" over "auto" beacuse of IE behavior to add scrollbars is contained element is bigger.
I started use the overflow method after reading this post fro Anne weblog:
"Super simple clearing floats"
http://annevankesteren.nl/2005/03/clearing-floats
A great find.
Mark
commented on Apr. 1st, 2008 at 7:00 pm
Please tell me that I'm responsible for this post haha
I can't wait to mess around with this.
Zack
commented on Apr. 1st, 2008 at 7:58 pm
Mark, I wish. I haven't even looked at your site since you sent it to me. I will though. Promise. Though, this might be helpful with your problems.
Add Your Comment