Ezilon.com - Target Your Audience, be Seen in Your Region

floating divs puts outside of parent div

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 282 posts

Joined: Feb 2005

Ok so i have a little problem. If i put a div inside another then the child div will make the parent div expand once the child div has more content inside of it(gets bigger). However, whenever i try to float the child div to the left or right it then gets forces outside the div (seems to change the z-index) and is no longer making the parent div larger (the parent div acts as if nothing is inside of it).

What am i doing wrong?

He has: 301 posts

Joined: May 2007

Try floating the outer container. If this is impractical, use this declaration in the CSS for the outer DIV:

{overflow: auto;}'

You may need to add a dimension to the container as well. "width:100%;" should work without upsetting things.

These establish a new "block formatting context." See here:
http://css-discuss.incutio.com/?page=FormattingContexts

Cordially, David
--
"Old web developers don't die, they degrade gracefully..."

They have: 282 posts

Joined: Feb 2005

sorry i figured it out, like a pratt i had a fixed height on it!! so course it was forced outside the div because the div could not enlarge.