|
|
Nested DIVs expansion...
|
|
|
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
I'm a novice here, but was wondering why one DIV placed inside a parent DIV will not cause the parent to expand when the child's content expands.
So, if I had a container DIV and placed another DIV inside containging some changeable content why is it that the child DIV will expand to accomodate the content, but the parent will not.
Is there something I'm missing?
Thanks!
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
Nevermind ... Overflow seems to have handled it.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status:
Offline
|
|
A unstyled, block-level parent element will expand to fit all of its content so long as the content isn't removed from the document flow. Content may be removed from the document flow by positioning it absolutely or floating it.
So, for example, if your child div is floated, then the parent will not wrap it.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
Ah ... makes sense. So, how do designers handle layouts with columns floated left or right? Is it just a matter of adjusting the parents margins, padding etc... to give the illusion that the child fits?
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
Originally Posted by headbirth
Ah ... makes sense. So, how do designers handle layouts with columns floated left or right? Is it just a matter of adjusting the parents margins, padding etc... to give the illusion that the child fits?
That's the usual method of doing things. You can also use the CSS display:table-* properties to get table-like behavior, but those don't work in IE.
A real shame, too, given that those properties are the answer to getting full table-like columns and such in CSS. Everyone but IE supports them now, but without IE support they're non-starters.
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|