I kept running into issues where a child div’s content would expand beyond its parent container. This was solved (using an answer I found on here) by setting the parent container’s overflow to “auto”.
My question is basically the subject line above: would there be a downside to setting my base/global style to include “overflow:auto” as the default? Since this simple addition seems to make parent containers properly contain their floating children, would in not make sense to default to that for everything and just change it when needed?
Thanks in advance.
You could end up having a scroll running across the bottom of the site or “specific divs” you have set overflow: auto.
Reading what you said about nested float divs not showing correctly;
This is because when you set a div to “float” you remove it from the natural flow of the site.
Have you tried fixing the float problem by setting the container div to
clear:both/left/right?this would clear the floated divs and set the natural flow back?
This could be your problem.