css float elements, div or whatever

If you didn’t know, instead of using a clear:both there’s a really simple and easy way to make a container (like div) have the height of it’s floating children.

Just give it the css attribute overflow:hidden;

Yes, that’s all.


`

parent

float:left;

`
parent

float:left;

`

parent
float:left;

`
parent

float:left;