Using overflow to Clear Floated Elements

If you have an element whose children are all floated, it won’t have any height to it. I’ve always just put an extra <div style=”clear: both;”> at the bottom of the container to force it to clear, but it looks like there’s been a much better way for a few years now. Alex Walker points out that you can just set overflow:auto on the container.

Leave a Reply

Your email address will not be published. Required fields are marked *