24 September 2008

Expand div to contain floated child elements

I am sure I am one among many thousands who will be eternally indebted to Quirksmode for its wealth of browser wisdom. Today I learned how to make a container expand to surround all of its floated child elements. On the container, put

style="overflow:auto;"
That's all! At least, for firefox - other browsers need width as well.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.