The overflow: hidden (or auto) is but one way to contain floats – its in the specs. It creates a new block formatting context, which will contain any floats. Another popular containment method is the clearfix method (some call it a hack, but its definitely not) which uses a pseudo class to add content after the float and clear it. This works similar to adding the extraneous div and clearing, but without the markup. There are other ways as well – no one way is perfect, so its best to know the various methods.
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".