Log in

View Full Version : Trying to make a div wrapper inherit the height of my nested content div



sparticuz13
07-25-2007, 02:37 AM
OK basically I'm trying to get my wrapper div to grow with the height of my content div. My goal is to get something like this http://www.ilovejackdaniels.com/

My site is centered horizontally. I'm using a wrapper div to center the site.

#wrapper {
position:relative;
width:1116px;
height:auto;
margin-top:0px;
margin-left:auto;
margin-right:auto;
}

I then have a content div that is the main portion of the page.

I want my site to have a small border image that surounds it like in the example link. I Know have to make a header and footer with the background image of my border. But I need help with the sides. I can make left and right border divs to contain the image using background-repeat or I can make a image that is as wide as my site and transparent with both ends have my 20px wide border and set as the background of my wrapper.

In either Idea I need to get the border div(s) to grow with the height of the content div. I can do this perfectly if I have a fixed height like I do width. But this site needs to change its content dynamically and therefore the height changes.

This seems to be a popular design but I just needs a some help or samples of how its being done.

Thanks
Chris