Hi Kenoli,

The thing to understand with this issue is page flow, or how div's line 
themselves up on the page.

Basically, any block level element will want to occupy the space starting in 
the upper left hand corner. Everything goes up and to the left. I tend to try 
and keep track of where the upper left hand corner is at any given time.

Then, within CSS we have some positioning rules (relative, absolute, static, 
fixed). Static is the default and does not need to be explicitly declared. 
Static follows the page flow by occupying the upper left corner. Relative is 
part of page flow and takes its positioning relative to the available upper 
left corner.

Absolute is not part of page flow so the elements or div's around it pretend it 
is not there. This is your issue. By using absolute positioned div's within 
relative positioned div's the div's really do not know the other is present. 

You could maybe do better by floating your AP div's.

Take a look at this for more information:

http://www.htmldog.com/guides/cssadvanced/layout/





From: Kenoli Oleari
Sent: Wed 1/30/2008 9:23 AM
To: CSS Mailing List
Subject: [css-d] Divs within divs


I have some divs whose position in relation to each other is  
critical, but which I need to have flexible as a group in relation to  
other items on the page.  I have placed them with absolute  
positioning within a div which has a relative positioning attribute.   
This works fine with one exception.  I would like it if these divs  
caused the outer div to expand as they expand.  It would also be  
useful in another similar case to have the containing div act as a  
limit on the divs it contains.  Esssentially I am wanting the inner  
divs to see the container as barrier to either expand or stay within.

This isn't the case.  The inside divs simply expand past the borders  
of the containing div, neither expanding it nor being limited by it.   
Text, and <p> tags cause the container to expand, or course.

I presume this has something to do with the positioning attributes.   
I think I need the absolute attribute for the inner divs to retain  
their relationship with each other.  Is there someone who can help me  
figure out what to do to achieve what I am trying to do?

Thanks

--Kenoli

Kenoli Oleari
1801 Fairview Street
Berkeley, CA  94703
Neighborhood Assemblies Network
510-601-8217, [EMAIL PROTECTED]
http://www.sfnan.org, http://www.horizonsofchange.com




______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to