Mar 6, 2008

overflow:auto hack

float will take element out of its flow layout, which means the original position if not floated is taken out. So if all content of a container is floated, the container contains nothing , so it's height/width is zero. To overcome this, you either float the element or add overflow:auto. Overflow is a hack and seems to be better choice. Because the container will expand as much as can. If you choose the float the container, you much specify the width to 100%, in some case, this also cause problem. Because if the container has padding, margin or border, the width is over 100%, because the actual width is add up of all.