Click to See Complete Forum and Search --> : CSS auto hight query


Megatron
06-23-2006, 08:37 AM
Hi,
I have a div which contains a background image. Within that div i want to place a few more divs which will contain images. The problem i'm having at the moment is that when i add images to the divs, the main div does not adjust it's height to fit them in. So i have an overlapping div.

This is the css for the larger div

#Layer9 {
position: absolute; left: 98px; top: 344px; width: 771px; height: 600px; z-index: 9;
background-image: url(blue_layout_imgready_09.gif);
background-repeat: repeat-x;
margin: 0px;
padding: 0px;

and this is a sample of the inner divs

#Layer24 {
position:absolute;
width:1px;
height:auto;
z-index:2;
left: 460px;
top: 236px;
background-image: url(advert_border.gif);
}


I wouldn't be too much of an CSS expert so the problem is probably easily resolved. Thanks

toicontien
06-23-2006, 10:45 AM
Absolute positioned elements are their own layers, called document flows. They have no relation to one another. There's a link in my signature "Quick Positioning Explanation" that will give some basic info about positioning.

Megatron
06-23-2006, 11:00 AM
thanks for the link, i'm finding it hard to make sense of it all. I'm new enough to css, which option should i be going for so?